Upgrade the current replication to GTIDs and replicationgtids.

Source: Internet
Author: User

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;

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.