HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlModerate

Setting Circular Replication in mysql

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
mysqlsettingcircularreplication

Problem

I have 3 MySQL servers say A,B,C.

What I want to do is that I want to make all of them master as well as slave.If there is update on any of the MySQL Servers it should be replicated to all of the Servers.

I have studied about the circular replication and found it can be implemented with it.

Can anybody please give me all the steps to accomplish the Replication as stated between three servers.

One More Point i want to ignore some of the tables from a database also.

Also What are caveats of this type of replication?

Solution

Rolando told you how to do it and his answer is excellent. The truth is, circular replication is an awful, terrible, terrible idea. Don't do it. Ever. "Absolutes are never true," but in this case, it's pretty close.

Instead of having a single point of failure, now you have three.

What if one of the servers goes down? Now replication is broken everywhere.

How do you replace it easily and align the binary log positions? You can't without doing some very complicated and error prone binary log analysis.

So, now you have to restore all three servers from a backup. Wait, was that backup taken at the same moment in time? Nope, because there's no way to make a transactional backup across multiple servers. So, you're left with broken replication and attempting to fix it with pt-table-checksum and pt-table-sync...or rebuilding the entire cluster from scratch.

Just because you can do something, doesn't mean you should. Don't do this, really. I'm not kidding.

Context

StackExchange Database Administrators Q#17529, answer score: 15

Revisions (0)

No revisions yet.