環境見上篇系列文章mysql
關閉GTID,不用中止服務,不影響線上業務sql
#SLVAE實例上中止複製 STOP SLAVE #SLVAE實例上查看複製的位置 SHOW SLAVE STATUS \G # 查看 Master_Log_File 和 Read_Master_Log_Pos對應的值 binlog.000012:1821 #從新 CHANGE MASTER CHANGE MASTER TO MASTER_AUTO_POSITION=0, MASTER_LOG_FILE='binlog.000012', MASTER_LOG_POS=1821; #開啓SLAVE START SLAVE;
SET @@GLOBAL.GTID_MODE=ON_PERMISSIVE;
SET @@GLOBAL.GTID_MODE=OFF_PERMISSIVE;
mysql> SELECT @@GLOBAL.GTID_OWNED; +---------------------+ | @@GLOBAL.GTID_OWNED | +---------------------+ | | +---------------------+ 1 row in set (0.00 sec)
SET @@GLOBAL.GTID_MODE=OFF;
gtid_mode=OFF enforce_gtid_consistency=OFF
MySQL5.7.6版本之後,支持在線修改GTID模式服務器
SET @@GLOBAL.ENFORCE_GTID_CONSISTENCY=WARN;
SET @@GLOBAL.ENFORCE_GTID_CONSISTENCY=ON;
SET @@GLOBAL.GTID_MODE=OFF_PERMISSIVE;
SET @@GLOBAL.GTID_MODE=ON_PERMISSIVE;
SHOW STATUS LIKE 'ONGOING_ANONYMOUS_TRANSACTION_COUNT';
SET @@GLOBAL.GTID_MODE=ON;
gtid_mode=ON enforce_gtid_consistency=1