MySQL replication be bi-directional

若如初见. 提交于 2019-12-07 09:30:56

问题


We have successfully set up a Master-Slave replication as described in MySQL literature.

However, I'm curious if anyone has set up a bidirectional replication. For example, if one has a Drupal or Wordpress installation. The first ('master') database server goes down, and the secondary ('slave') picks up. All the while, users continue to make edits, writing new data. When the First database server is restarted, can changes written to the Second be replicated upward to the First?

That is: are there other replication strategies than only the Master-Slave?


回答1:


You can do Master-Master replication. Unfortunately, Neither Drupal or Wordpress support this. The best thing to do is Master-Slave or Master-Slave-Slave, then make the first slave in the chain the new Master if the original master goes down. Then reconfigure the old Master to slave off the new Master (or last slave in the chain).

How often does your mysql server go down?




回答2:


Master-Master Replication has some disadvantages. For example data inconsistencies can easily occur.

Have you tried synchronous multi-Master Replication with Galera Cluster for MySQL?

http://codership.com/



来源:https://stackoverflow.com/questions/10626756/mysql-replication-be-bi-directional

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!