MySQL GTID 可以用于主-主拓扑吗?
Can MySQL GTIDs be used in a master-master topology?
使用基于坐标的复制时,MySQL 可以在主-主拓扑中让两个节点中的每一个节点相互复制。
随着 GTID 在 MySQL 5.6 中的引入,启用 GTID 复制时是否可以以相同的方式使用相同的拓扑?
我没有立即看到任何不这样做的原因,但我无法在网上找到任何关于它的信息,我只是不想在几周后发现一堆奇怪的腐败问题。
Mysql 关于 restrictions in replication with GTID do not mention that master - master replication is not allowed. I also found a Percona blog entry 的文档明确表示这是允许的:
Q: Does GTID provide any benefit to master-master replication? If yes,
how? Q: Is ACTIVE ACTIVE MASTER MASTER successful in MySQL with GTID?
A: GTIDs don’t change the nature of MySQL replication: for instance it
is still asynchronous and if you write on both masters in a
master-master setup, there is still no write conflict detection
mechanism. The main benefit of GTIDs is that any change of the
replication topology is easy because you no longer need to run complex
calculations to find the right binlog positions when connecting a
slave to a new master. So master-master replication can be configured
with GTIDs, it does not provide a lot of benefits compared to
position-based replication as you will never change the replication
topology. And having a setup where both masters receive writes is
still not recommended with GTIDs.
使用基于坐标的复制时,MySQL 可以在主-主拓扑中让两个节点中的每一个节点相互复制。
随着 GTID 在 MySQL 5.6 中的引入,启用 GTID 复制时是否可以以相同的方式使用相同的拓扑?
我没有立即看到任何不这样做的原因,但我无法在网上找到任何关于它的信息,我只是不想在几周后发现一堆奇怪的腐败问题。
Mysql 关于 restrictions in replication with GTID do not mention that master - master replication is not allowed. I also found a Percona blog entry 的文档明确表示这是允许的:
Q: Does GTID provide any benefit to master-master replication? If yes, how? Q: Is ACTIVE ACTIVE MASTER MASTER successful in MySQL with GTID?
A: GTIDs don’t change the nature of MySQL replication: for instance it is still asynchronous and if you write on both masters in a master-master setup, there is still no write conflict detection mechanism. The main benefit of GTIDs is that any change of the replication topology is easy because you no longer need to run complex calculations to find the right binlog positions when connecting a slave to a new master. So master-master replication can be configured with GTIDs, it does not provide a lot of benefits compared to position-based replication as you will never change the replication topology. And having a setup where both masters receive writes is still not recommended with GTIDs.