开发者社区> 问答> 正文

rds数据GTID同步出错

报错日志:
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

展开
收起
续写第二季 2016-08-04 21:31:31 9023 0
3 条回答
写回答
取消 提交回答
  • 如果遇到这个问题 @@GLOBAL.GTID_PURGED can only be set when @@GLOBAL.GTID_EXECUTED is empty
    可以尝试
    stop slave -> reset master ->set global gtid_purged = 'xxx'; # xxx是你主库上查到的value。

    2019-07-17 20:02:42
    赞同 展开评论 打赏
  • @@GLOBAL.GTID_PURGED can only be set when @@GLOBAL.GTID_EXECUTED is empty

    2019-07-17 20:02:42
    赞同 展开评论 打赏
  • https://github.com/ideal

    这个应该是由于你在主库上执行过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的事务了。

    2019-07-17 20:02:42
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
搭建电商项目架构连接MySQL 立即下载
搭建4层电商项目架构,实战连接MySQL 立即下载
PolarDB MySQL引擎重磅功能及产品能力盛大发布 立即下载

相关镜像