MySQL – How to Migrate from Master-Slave to Master-Master Replication

ArchitectureMySQLreplication

We currently run 2 large mysql master-slave replication trees.

Each tree is built with one master, several 'middle' slaves replicating from the master, and 'end' slaves replicating from the 'middle' slaves. For example:

                              - end slave
            - middle slave  - - end slave

-  master - - middle slave  - - end slave

            - middle slave  - - end slave
                              - end slave

I would like, if possible to get rid of the master, and promote the 'middle' slaves to be the masters in master-master replication. Example:

                        - end slave
              master  - - end slave

              master  - - end slave

              master  - - end slave
                        - end slave

Is this possible? What would be the process I should follow? What sort of downtime should I expect?

Thank you very much in advance!

Best Answer

We had wanted to make this change in order to minimize the necessary changes to infrastructure, keeping us from needing to raise a galera cluster and attempting an online switch to the new infrastructure.

However, we have decided to implement the necessary resources to raise a mysql cluster and leave the old replication structure. It seems like there is no real alternative.

Thank you for your comments.