Ryan Copley
Ryan Copley

Reputation: 873

Mysql replication, keep ALL servers in sync no matter which was updated

I have 3 servers that are replication, but currently only one is a master and the other two are slaves. I would like it so that if either of the slaves are updated / inserted, that the change is propogated to all the other slaves and the master. How would I accomplish this?

My best guess is to make them all masters, and to slave each other. Is this optimal?

Upvotes: 2

Views: 118

Answers (1)

Ray
Ray

Reputation: 41428

This is not possible with standard mysql master-slave replication. You can try to accomplish this with a master-master setup (see this tutorial http://www.howtoforge.com/mysql_master_master_replication), but this requires quite a bit of futz to ensure duplicate keys are not created. Not sure if this can handle 3 masters though.

Honestly, vanilla MySQL is not the right technology for what you want for distributed DB's like this.

There is Mysql cluster which might do what you need: http://www.mysql.com/products/cluster/ and some other technologies (mostly NOSQL) like cassandra and mongoDB.

Upvotes: 3

Related Questions