二:online disable GTID replication
1. Execute the following on each slave, and if you using multi-source replication, do it for each channel and include the FOR CHANNEL channel clause:
STOP SLAVE [FOR CHANNEL 'channel'];CHANGE MASTER TO MASTER_AUTO_POSITION = 0, MASTER_LOG_FILE = file, /MASTER_LOG_POS = position [FOR CHANNEL 'channel'];START SLAVE [FOR CHANNEL 'channel'];##如果你使用了多源復(fù)制,那么為每個channel執(zhí)行如上操作2. On each server, execute:
SET @@GLOBAL.GTID_MODE = ON_PERMISSIVE;3. On each server, execute:
SET @@GLOBAL.GTID_MODE = OFF_PERMISSIVE;4. On each server, wait until the variable @@GLOBAL.GTID_OWNED is equal to the empty string. This can be checked using:
SELECT @@GLOBAL.GTID_OWNED;NOTE:On a replication slave, it is theoretically possible that this is empty and then nonempty again. This is not a PRoblem, it suffices that it is empty once5. 備份
If you use binary logs for anything else than replication, for example to do point in time backup or restore: wait until you do not need the old binary logs having GTID transactions.如果你的binlog用于恢復(fù),在執(zhí)行完第四步后。在備份腳本所在實例執(zhí)行flush logs;并進(jìn)行一次全備6. On each server, execute:
SET @@GLOBAL.GTID_MODE = OFF;7. On each server, set gtid-mode=OFF in my.cnf.
在每個實例的配置文件中添加gtid-mode=OFF8. 你也可以選擇設(shè)置enforce_gtid_consistency為OFF
set global enforce_gtid_consistency=OFF(同時在配置文件中添加)參考鏈接:
http://blog.csdn.net/shaochenshuo/article/details/54862603http://blog.csdn.net/shaochenshuo/article/details/54138317http://blog.csdn.net/shaochenshuo/article/details/54138317http://dev.mysql.com/doc/mysql-replication-excerpt/5.6/en/replication-gtids-concepts.htmlhttp://dev.mysql.com/doc/mysql-replication-excerpt/5.7/en/replication-gtids-concepts.html?ff=nopfplshttps://dev.mysql.com/worklog/task/?spm=5176.100239.blogcont41200.6.xtY06T&id=7083http://dev.mysql.com/doc/refman/5.7/en/replication-mode-change-online-disable-gtids.html?ff=nopfpls
新聞熱點
疑難解答