1, must master the library two data is consistent, that is, the current from the library no data delay situation. And the main library can no longer have data updates. Standby stop slave thread: stop slave;
Main Library: Show master status;
Prepare library: show slave status;
The relay_master_log_file of the repository is the same as the main library's file, and the Exec_master_log_pos of the repository is the same as the position of the main library.
2. Note the file and position information at the time of the main library
3, modify the MY.CNF configuration of the main repository, add the parameter configuration as follows:
Gtid_mode=on
Enforce_gtid_consistency=on
Log_slave_updates=on
Binlog_format=row
Skip_slave_start=1
Log_bin=master-binlog
Slave_parallel_workers=4
4, restart the main repository, note the main library at this time show master status information, that is, file, position, Gtid number. Check the Master repository error log. Check the main repository show variables like '%gtid% '; Gtid mode is turned on.
5, in the configuration from the library slave.
Stop slave;
Reset slave;
SET @ @global. gtid_purged= ' 77d12988-29c1-11e6-a323-fa163ea5bbe1:1-88806 ';
Change MASTER to master_host= ' 192.168.1.1 ', master_port=3306, master_user= ' slave ', master_password= ' slave ', master_ Auto_position=1;
Start slave;
6. Check the slave thread state of the standby library. show slave status\g; You can perform some DML or DDL operations in the main library to see if the Gtid value is incremented if it is synchronized properly.
If you are new from the library and the main library has started Gtid mode, you can use the latest hot spare data from the main library and the Gtid value corresponding to this data, when configuring Slave, remember set @ @global. gtid_purged= "Gtid value", The others are the same as above.
Information:
Http://www.cnblogs.com/zejin2008/p/5753934.html
This article is from the "thick Product Thin Hair" blog, please make sure to keep this source http://1057212.blog.51cto.com/1047212/1891714
mysql5.6 traditional replication to Gtid multi-threaded replication