MySQL 5.7 Traditional Replication to GTID Online Switch
Previous question:
Requires MySQL 5.7.6 and later versions.
All members in the group gtid_mode are off.
Implementation steps:
All Server execution
set @@global.enforce_gtid_consistency = warn;
Special Note: This step is a step of Guan Jian and can not be used without warning.
2.Execute on all servers:
set @@global.enforce_gtid_consistency = on;
3.Execute on all Servers (do not care about the first and the last, but the execution must be finished):
set @@global.gtid_mode = off_permissive;
carried out:
set @@global.gtid_mode=on_permissive;
In fact, the logs generated in this step are all logs with GTID.This step claims to not care about any nodes, but it is recommended to execute it on the slave first and then execute it on the master in terms of management.
Confirm that the traditional binlog is copied, the value is 0
show status like'ongoing_anonymous_transaction_count';
All nodes need to be confirmed as 0.
All nodes judge show status like'ongoing_anonymous_transaction_count'; is zero
All nodes can also execute: flush logs; Used to switch logs.
All nodes enable gtid_mode
set @@global.gtid_mode=on
Write gtid_mode = on related configuration into the configuration file
gtid_mode=on
enforce_gtid_consistency=on
Enable Gtid's automatic discovery node replication:
stop slave;
change master to master_auto_position=1;
start slave;
complete. Good Luck.
0 Comments