Switching the slave from chain replication to master-slave
If you have a chain replication setup (such as server A --> sever B --> server C) and you wish to make server C a direct slave of server A, you have to stop replication on server B, let server C catch up with server B, and then find the coordinates of server A corresponding to the position where server B stopped. Using those coordinates, you can execute a CHANGE MASTER TO
command on server C and make it a slave of server A.
How to do it...
- On server B: Stop the slave and note down the master status:
mysql> STOP SLAVE; Query OK, 0 rows affected (0.04 sec) mysql> SHOW MASTER STATUS; +---------------------+----------+--------------+------------------+-------------------+ | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set | +---------------------+----------+--------------+------------------+-------------------+ | server_B-bin.000003 | 44627878 | | | ...