0

I currently have MySql Master-Master replication set-up with Read_only on Master2. There were lot of sync issues so I've stopped replication from Master2 to Master1 by stopping the Slave in Master1. Master1 is currently replicating to Master2 with no issues. Is this enough or is there another best way to revert to Master-Slave replication. Should I run RESET SLAVE on Master1 to completely stop Replication from Master2 to Master1.

1 Answer 1

0

On a basic level, what you have done is enough, but there is a risk it could be re-enabled by mistake as long as the Binary logs exist on master2.

So, if this is just a temporary thing then running RESET SLAVE will remove the master_log_file and read_master_log_pos values, thus preventing replication from starting again by mistake, but maintaining the other values for future use.

If this is going to be permanent, then RESET SLAVE ALL will remove all the replication information (include host, port, user, password etc).

2
  • Will Reset Slave work with mysql version 5.7. Will restart of mysql server starts SLAVE in Master1? Also, if I have to start replication form Master2 to Master1 again, should I just change the Master log position in Master1.
    – Jos
    Commented Feb 15, 2021 at 22:58
  • 5.7-yes. Restart Server-yes and no, it will restart but not connect as there are no logfile or pos (add skip_slave_start to your my.cnf file to stop replication starting automatically). To restart replication you will need a full CHANGE MASTER statement (host, port, file, pos, user, pass).
    – IGGt
    Commented Feb 16, 2021 at 9:38

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.