把目前的replication升級到GTIDs,replicationgtids

來源:互聯網
上載者:User

把目前的replication升級到GTIDs,replicationgtids
把目前的replication升級到GTIDs
把所有的master和slave
1.把所有的master和slave
set @@global.read_only=on;  或 set global read_only=on;
2.把所有的master和slave
service mysql stop
3.把所有的master和slave,開啟GTIDs
開啟GTIDs需要在所有機器上都配置gtid-mode,log-bin、log-slave-updates,
enforce-gtid-consistency(在5.6.9之前是--disable-gtid-unsafe-statement),
另外slave在這個環節需要增加skip-slave-start參數
master配置
[mysqld]
gtid-mode=on
log-bin
log-slave-updates
enforce-gtid-consistency
slave配置
[mysqld]
gtid-mode=on
log-bin
log-slave-updates
enforce-gtid-consistency
skip-slave-start
4.啟動所有server服務,重新設定slave
service mysql start
slave下執行
change master to
master_host='slave_ip',
master_port=3306,
master_user='dba',
master_password='beifen',
master_auto_position=1;
start slave;


5.6以後可以多線程方式傳輸二進位日誌
slave-parallel-workers=N


錯誤跳過
stop slave;
set global sql_slave_skip_count=1;   --gtid不支援,這個功能是基於position編號的
start slave;


GTIDs模式下錯誤處理
stop slave;
set gtid_nex='uuid:next_id';
begin;
commit;
set gtid_next='AUTOMATIC';
start slave;

相關文章

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.