Upgrade the current replication to GTIDs and replicationgtids.
Upgrade current replication to GTIDs
Put all the master and slave
1. Put all the master and slave
Set @ global. read_only = on; or set global read_only = on;
2. Put all the master and slave
Service mysql stop
3. Enable GTIDs for all master and slave
To enable GTIDs, you must configure gtid-mode, log-bin, and log-slave-updates on all machines,
Enforce-gtid-consistency (before 5.6.9 is -- disable-gtid-unsafe-statement ),
In addition, slave needs to add the skip-slave-start parameter in this step.
Master Configuration
[Mysqld]
Gtid-mode = on
Log-bin
Log-slave-updates
Enforce-gtid-consistency
Slave Configuration
[Mysqld]
Gtid-mode = on
Log-bin
Log-slave-updates
Enforce-gtid-consistency
Skip-slave-start
4. Start all server services and reconfigure slave
Service mysql start
Run the following command under slave:
Change master
Master_host = 'slave _ ip ',
Master_port = 3306,
Master_user = 'dba ',
Master_password = 'beifen ',
Master_auto_position = 1;
Start slave;
Binary logs can be transmitted in multiple threads after 5.6
Slave-parallel-workers = N
Error skipping
Stop slave;
Set global SQL _slave_skip_count = 1; -- gtid is not supported. This function is based on position number.
Start slave;
Handle errors in GTIDs Mode
Stop slave;
Set gtid_nex = 'uuid: next_id ';
Begin;
Commit;
Set gtid_next = 'automic ';
Start slave;