详细参见 https://www.jianshu.com/p/19cb0f16dea4
部分命令
CHANGE MASTER TO
MASTER_HOST = '10.211.55.11',
MASTER_USER = 'repl_user',
MASTER_PASSWORD = 'repl_passwd',
MASTER_PORT = 3306,
MASTER_LOG_FILE='mysql-bin.000006',
MASTER_LOG_POS=1327,
MASTER_RETRY_COUNT = 60,
MASTER_HEARTBEAT_PERIOD = 10000;
reset slave;
start slave;
show slave status;
stop slave;
CREATE USER repl_user IDENTIFIED BY 'repl_passwd';
flush tables with read lock;//设置只读
show master status;
unlock tables;//取消锁