• notice
  • Congratulations on the launch of the Sought Tech site

MySQL 5.7 Traditional Replication to GTID Online Switch

Previous question:

  1. Requires MySQL 5.7.6 and later versions.

  2. All members in the group gtid_mode are off.

Implementation steps:

  1. 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;

  1. 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.

  1. 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.

  1. All nodes judge show status like'ongoing_anonymous_transaction_count'; is zero

All nodes can also execute: flush logs; Used to switch logs.

  1. All nodes enable gtid_mode

set @@global.gtid_mode=on

  1. Write gtid_mode = on related configuration into the configuration file



  1. Enable Gtid's automatic discovery node replication:

stop slave;

change master to master_auto_position=1;

start slave;

complete. Good Luck.


Technical otaku

Sought technology together

Related Topic


Leave a Reply