一主二从改成级联复制架构步骤

一主二从改成级联复制架构步骤

A->(B,C)
现在需要将C作为B的从库。
(1)、在B和C中停止同步
# 先停止C的同步
# 在停止B的同步
stop slave;

(2)、# 以B库的为准,找Relay_Master_Log_File和Exec_Master_Log_Pos的值
例如:
Relay_Master_Log_File: mysql-bin.000013
Exec_Master_Log_Pos: 2014

(3)、在C库中操作
mysql> start slave until master_log_file='mysql-bin.000013',master_log_pos=2014;
mysql> show slave statusG;

(4)、在B库中操作
show master status; # 记录一下结果
start slave;
show slave statusG;

(5)、在C库中操作
stop slave ;
CHANGE MASTER TO
  MASTER_HOST='192.168.142.144',
  MASTER_USER='repuser',
  MASTER_PASSWORD='repuserpwd',
  MASTER_PORT=3306,
  MASTER_AUTO_POSITION = 1;
start slave ;
show slave statusG;
原文地址:https://www.cnblogs.com/bjx2020/p/12119881.html