0

We have MySql 5.7 running in Centos 7 in cloud environment. We have the master-master working properly. One master gets the writes which replicates to the other master. The second master is a hot standby in case the 1st master dies.

Currently we need to rebuild the masters on a somewhat regular basis. We are doing this by restoring from mysql backups and then adding the new master into the replication.

We would like to avoid using the mysql backups for replacing masters. We would like to turn off a Master, Build a new Master, configure the masters and then allow the Master (that we did not replace) to populate the Master (that we replaced).

Any suggestions?

6
  • Please explain the purpose of regular "rebuilding".
    – Rick James
    Commented Aug 6, 2019 at 17:22
  • Sorry for my delay. We rebuild these regularly just means we need an automated means to sync. We do not want to have to do a backup and restore (though this can be automated). We want to be able to rebuild a machine (terminate it and stand up a new one, configure it) and have it sync with the other master that is still up. So we will always have 1 master up at all times.
    – GOOGGOOG
    Commented Aug 12, 2019 at 11:51
  • Rebuilding involves first loading a not-too-old dump, then letting Replication "catch up". I don't think there is a single-step way to rebuild a second Master or Slave.
    – Rick James
    Commented Aug 12, 2019 at 15:10
  • Ok. I was thinking I could take a Master (a slave) without any dump on it. Then tell it to get the logs of the Running Master from its very first record.
    – GOOGGOOG
    Commented Aug 12, 2019 at 17:48
  • True, if you save all the binlogs, you can reload from that. But it will be slower and sloower and slooower as the binlogs grow.
    – Rick James
    Commented Aug 12, 2019 at 23:22

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.