MySQL – Adding New Slave to Master-Master Replication

mariadbMySQLreplication

I've got two mysql servers, A and B which are currently set up in a circular, MASTER MASTER replication scheme. I need to add third server to the mix, C as a SLAVE to B as pictured below:

A <---> B
        |
        v
        C

I just made an attempt at doing this, but I forgot to take into account the fact that writes that go from A to B will not make it to C without turning on log-slave-updates on B being turned on.

My question: if I turn log-slave-updates on for B, isn't A going to pick up on those log entries again execute them a second time, thereby spawning some sort of black hole that could threaten to swallow the planet?

Best Answer

As long as the values of server-id are different for each server, no planets will be swallowed. Not even Pluto.

I suggest you turn on binlog and log_slave_updates on all servers. Then rebuild C from B (as, I assume, you did once). Then proceed. I would not want to try to do it from the current C, which is missing stuff.