4

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?

Rick
  • 591
  • 1
  • 9
  • 23

2 Answers2

3

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?

Ray
  • 40,256
  • 21
  • 101
  • 138
  • Thank you Ray for the response. The frequency of server trouble not very often -- actually very rare, but the projects that it's supporting are becoming higher profile. At the moment I have the luxury of time; so, I'm trying to add an ounce of prevention. Would you have knowledge of any commercial products to keep two databases (MySQL) in sync? – Rick May 17 '12 at 13:21
  • @Richard there is MySQL cluster, which may be your best option if you are tied to MYSQL another person's libraries (Wordpress). Honestly, if you're not under enormous load, I'd look at Master-Slave-Slave setup. Any one can fail and you can continue to work (with protection of another copy) while you fix and put the down machine back into the queue. – Ray May 17 '12 at 13:26
  • Something akin to this: http://www.webaugur.com/webdev/19-mysql-master-master-slave-s-database-replication.html thank you! – Rick May 17 '12 at 17:03
  • It would be best if you described the master-master issues sot hat people can make their own judgement about the situation they face. – New Alexandria Sep 24 '12 at 19:03
  • @NewAlexandria The question asked about use for with Drupal or Wordpress. Neither support master-master, so it's not an option for the scenario. – Ray Sep 24 '12 at 19:10
  • @Ray you're right. This is probably the best answer for the question at-hand. – New Alexandria Sep 24 '12 at 19:13
1

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/

shinguz
  • 11
  • 1