Master Replication Down -Slave replication make Mater

Post date: Aug 13, 2020 5:13:9 AM

Assuming you have 2 MySQL Slaves: slave 1 and slave 2. In case your master is down, you decide to promote the slave 1 to become a new master. I suggest a procedure to follow:

Make sure that all slaves has processed any statements in their relay log with:

mysql> STOP SLAVE IO_THREAD; mysql> SHOW PROCESSLIST; to see `Has read all relay log` state.

on slave 1, promote it to become a master with:

mysql> STOP SLAVE; mysql> RESET MASTER;

on slave 2, point to new master with:

mysql> CHANGE MASTER TO MASTER_HOST='slave 1'; mysql> START SLAVE;