首页 > 学院 > 开发设计 > 正文

mysql 5.7 disable GTID replication

2019-11-09 13:33:33
字体:
来源:转载
供稿:网友
MySQL 5.7 disable GTID replicationmysql 5.7.6及以后版本支持在线disable GTID replication,所以你可以使用传统的方法或者在线方法 disable GTID replication一:传统方法disable GTID replication参考 mysql 5.6 disable GTID replication

二: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'];##如果你使用了多源复制,那么为每个channel执行如上操作  

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 once

5. 备份

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用于恢复,在执行完第四步后。在备份脚本所在实例执行flush logs;并进行一次全备

6. On each server, execute:

SET @@GLOBAL.GTID_MODE = OFF;

7. On each server, set gtid-mode=OFF in my.cnf.

在每个实例的配置文件中添加gtid-mode=OFF

8. 你也可以选择设置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


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表