-1

Any one knows about MySQL Replication Relay for Peer-to-Peer Replication for Multi-master replications?

Please share if you know anything with example and syntax for multiple clients with as masters replications in MySQL.

  • What is your goal? – Rick James Jan 11 '18 at 8:36
  • i need to create one web app with multi master replication database connectivity. – kaushik Jan 11 '18 at 11:04
  • Still unclear -- Why multi-master? Will there be Slaves? You mentioned Relays, but that is not a necessary part of the system. Etc. – Rick James Jan 11 '18 at 14:32
  • a live slaves are also for masters of them slaves. e.g. server-A is a master and Server-B is a slave of Server-A but Server-B is also master of Server-C. – kaushik Jan 16 '18 at 6:51
  • "A -> B -> C" is not considered "multi-master". A is a Master, B is a Relay (acting both as a Master and a Slave), and C is a Slave. There are only a few useful cases for such; can you elaborate on what the goal is of the configuration? Perhaps from that, you could start a new Question. (Getting this question off Hold is hard.) – Rick James Jan 16 '18 at 12:54
1

(The question is much too broad. So, I will give only a broad explanation of Master, Slave, and Relay.)

A server can be a Master, a Slave, or both.

Dual-Master (a form of multi-master) has both servers being both Master and Slave. By having server_id different for the two servers, Replication is smart enough not to get into a loop.

In a multi-master setup, one can write to any Master. There are many caveats one needs to be aware of.

A "Relay" server acts as a Slave to receive data from a Master, then passes it on to Slave(s).

In a Master-Slave or Master-Relay-Slave setup, one should write only to the Master. Writing to a Relay or Slave is asking for trouble.

Clients can talk to any MySQL server; it does not matter whether they are Master or Slave or both. However, typically one controls which server to talk to -- in order to control load balancing, HA, etc.

Galera and InnoDB Cluster / Group Replication are tools to make Multi-Master configurations more manageable.

  • will you please send me steps for multi master replication creation and how to use? – kaushik Jan 11 '18 at 10:31
  • Do not use Multi-Master, it is fraught with issues of duplicate keys, hung replication, difficulties in recovery, etc. – Rick James Jan 11 '18 at 14:32

Not the answer you're looking for? Browse other questions tagged or ask your own question.