资料内容:
5.1 找到最后一个库的 GTID
SET @@GLOBAL.GTID_PURGED=/*!80000 '+'*/ 'a97612c1-b947-11ea-bcf9-005056812835:1-
19065';
5.2 终止 SLAVE
stop slave;
5.3 加入其他的 GTID
先把主库的 binlog 先备份下,
/data/mysqlLog/logs
mkdir binlogbak
cp mysql-bin.000001 binlogbak/
# 设置多个 GTID
SET @@GLOBAL.GTID_PURGED=/*!80000 '+'*/ 'a97612c1-b947-11ea-bcf9-005056812835:1-
19065,
39e42c4d-876f-11ea-8229-286ed488e793:1-31,
5d7ef438-f249-11ea-a518-0894ef181fcf:1-6107,
8a426026-b5e7-11ea-8816-0050568399c4:1-62290,
f3d8b026-ba76-11ea-985d-000c29b82d1f:1-36379'
5.4 添加从库
change master to
master_host='192.168.100.2',
master_user='repl',
master_password='123456',
master_auto_Position=1 for channel 'ims_chongqing';
5.5 查看是否同步
# 在 100.1 上删除 tb1
use db01;
drop table tb1;
# 在 100.5 上查看是否同步:
use db01;
show tables;
+--------------------------------+
| Tables_in_db01 |
+--------------------------------+
| equitment_info |
| event_code_info |
236第 3 章 技术分享
237
| ims_monitor |
| oee_data |
| oee_process_re |
+--------------------------------+