报错日志:
2016-08-04 21:23:16 18672 [ERROR] Error reading packet from server: The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requires. (server_errno=1236)
2016-08-04 21:23:16 18672 [ERROR] Slave I/O: Got fatal error 1236 from master when reading data from binary log: 'The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requires.', Error_code: 1236
2016-08-04 21:23:16 18672 [Note] Slave I/O thread exiting, read up to log 'FIRST', position 4
如果遇到这个问题 @@GLOBAL.GTID_PURGED can only be set when @@GLOBAL.GTID_EXECUTED is empty
可以尝试
stop slave -> reset master ->set global gtid_purged = 'xxx'; # xxx是你主库上查到的value。
@@GLOBAL.GTID_PURGED can only be set when @@GLOBAL.GTID_EXECUTED is empty
这个应该是由于你在主库上执行过purge binary logs
,然后当从库change master的时候,却要执行那些事务。
你可以在主库上先查找哪些gtid被purge了。show global variables like 'gtid_purged';
然后拿着这个value,去从库上依次stop slave;
set global gtid_purged = 'xxx'; # xxx是你主库上查到的value。
start slave;
这样能跳过执行被主库已经purge的事务了。
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。