Thesql replication

MySQLreplication

I have a master mysql server (M1) with two replicating slaves behind it. I also have another master mysql server (M2) with it's two slave servers. The slave servers currently replicate everything from it's respective master.

I would need to change one master server (M1) so that it replicates some tables from M2. The tables it (M1) will replicate will be set as read-only (user privilege will be changed).

This is a production set up. I would like to know whether it is possible? If so, how?

Best Answer

Yes it should be possible.

You can configure M1 the same way you configured the slaves of M2, but additonally add the option replicate-do-db and replicate-do-table to only have the tables you need be replicated into M1.

Please note there are a lot of "gotchas" with these two options, so it is best to read the linked help pages carefully.