MySQL replication be bi-directional

2019-05-06 04:59发布

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?

2条回答
对你真心纯属浪费
2楼-- · 2019-05-06 05:09

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?

查看更多
该账号已被封号
3楼-- · 2019-05-06 05:26

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/

查看更多
登录 后发表回答