Change Replication Topology A->B->C to A->B,C (Doc ID 1962618.1)

tech2022-12-17  114

Change Replication Topology A->B->C to A->B,C (Doc ID 1962618.1)To Bottom

In this Document

  

 

APPLIES TO:

MySQL Server - Version 5.5 and later Information in this document applies to any platform.

GOAL

Change from master A replicating to B which replicates to C, to master A replicating to slaves B and C.

SOLUTION

Procedure:

Stop replication on slave B:  

STOP SLAVE;

Examine Master_Log_File and Exec_Master_Log_Pos from B  

SHOW SLAVE STATUS\G

Make sure that sever C has catched up all the updates from B by issuing  

SHOW SLAVE STATUS\G

on server C until you see Slave_IO_State = Waiting for master to send eventStop replication on slave C:  

STOP SLAVE;

Change replication source on server C using the values from step 2:  

CHANGE MASTER TO master_host='A', master_log_file=X', master_log_pos=Y;

Make sure proper replication user is configured.Start replication on server C  

START SLAVE;

Start replication on server B  

START SLAVE;

mysqld_log-slave-updates may be disabled at any later time, when there is some maintenance window for example, that's not necessary however, though will save a bit of disk space and hardware resources on server B.

REFERENCES

https://dev.mysql.com/doc/en/replication-howto-repuser.htmlhttps://dev.mysql.com/doc/en/replication-options-slave.html#option_mysqld_log-slave-updatesNOTE:1444892.1 - Change Replication Topology A->B,C to A->B->C
最新回复(0)