2016年11月8日

MairaDB Multi-source replication 多源複製筆記

建立
# CHANGE MASTER 'connection_name_1' TO MASTER_HOST='10.240.0.1', MASTER_USER='slave', MASTER_PASSWORD='slave_password', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=496;

# CHANGE MASTER 'connection_name_2' TO MASTER_HOST='10.240.0.2', MASTER_USER='slave', MASTER_PASSWORD='slave_password', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=496;

全體指令
# start all slaves;
# stop all slaves;
# show all slaves status\G

單一指令
# change master 'connection_name' .........
# reset slave 'connection_name';
# start slave 'connection_name';
# stop slave 'connection_name';
# show slave 'connection_name' status\G

跳過錯誤
1. stop slave 'connection_name';
2. set @@default_master_connection='connection_name';
3. set global sql_slave_skip_counter=1;
4. start slave 'connection_name';


reference:https://mariadb.com/kb/zh-cn/multi-source-replication/

0 意見:

張貼留言