I want to make a dedicated SLAVE machine for data replication of three database on three different servers. In other words, I want to do Multiple Master => SIngle Slave replication.
Is there any way to do this, as simple as it can be ?
Thanks !
MySQL Master Master replication is a development of master-slave replication that addresses its major flaws. This method of replication requires two or more master nodes that can handle both read and write requests. Additionally, each of your masters can have several slave nodes.
Multi source replication is supported as of MariaDB 10.0 and MySQL 5.7 . Basically this means that a replica is allowed to replicate from multiple masters. To enable this, the replica should not have multiple masters writing to the same schema as this would lead to conflicts in the write set.
The MySQL replication feature allows a server - the master - to send all changes to another server - the slave - and the slave tries to apply all changes to keep up-to-date with the master.
Multi-master replication (a slave with more than one master) is not supported by MySQL (besides MySQL Cluster). You can do a master-master replication of a circular (ring) replication (described here or here).
In High performance MySQL 2nd edition the authors describe a way to emulate multi-master replication using a clever combination of master-master replication and the Blackhole
storage engine (Chapter 8 Replication > Replication Topologies > Custom Replication Solutions > Emulating multimaster replication p. 373 - 375).
They show two possibly topologies:
Using two co-masters (allowing to switch the master of the slave from Master 1 to Master 2)
Blackhole
so that the data is not effectively stored on Master 1.Blackhole
so that the data is not effectively stored on Master 2
Using a master-chain
Blackhole
so that the data is not effectively stored on Master 2
Please note that this setup only allows you to send updates to DB1 through Master 1 and updates to DB2 to Master 2. You cannot send updates to either table to arbitrary masters.
Pehaps it's possible to combine the described solution with the hack for a true master-master replication (allowing updates to both masters) that uses some sort of autoincrement-mangling and is described here or here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With