重庆分公司,新征程启航

为企业提供网站建设、域名注册、服务器等服务

启用auto_position=1一直报错

启用auto_position=1一直报错 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

我们拥有十载网页设计和网站建设经验,从网站策划到网站制作,我们的网页设计师为您提供的解决方案。为企业提供网站制作、网站建设、微信开发、小程序开发手机网站制作设计H5响应式网站、等业务。无论您有什么样的网站设计或者设计方案要求,我们都将富于创造性的提供专业设计服务并满足您的需求。

gtid中一些变量的理解

Retrieved_Gtid_Set: 接收到gtid集合

Executed_Gtid_Set: slave 已经执行过gtid集合,这个值使用从库的gtid_executed 这个变量初始化

gtid_executed:执行过的gtid集合

gtid_purged:已经被purge清除掉gtid集合

在执行start slave  的时候 ,如何计算起始的gtid值/集合

在从库已经执行的gtid集合

gtid_executed={0dd527e9-af3e-11e8-9ed6-00505683b926:1-62,0dd527e9-af3e-11e8-9ed6-00505683b927:1-3,87cf7b97-c393-11e8-845b-005056a95814:1,bb014309-e1a6-11e8-b284-00505683b926:1-12,c488995b-e256-11e8-abb7-00505683b926:1-9}

主库上执行的gtid集合

master_gtid_executed = { c488995b-e256-11e8-abb7-00505683b926:1-10 }

主库发送给从库的第一个gtid值(也可能是一个集合)

send_first_gtids={master_gtid_executed - gtid_executed}

send_first_gtids = { c488995b-e256-11e8-abb7-00505683b926:10 }

这个时候就计算出master需要发送给slave的第一个gtid值/集合,

如果这个值已经被master purge清理掉了(也就说在master的binlog文件中找不到了)

slave 就会报错  1236 错误 

具体报错如下 :

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

对于这种错误 有两种解决方案 

1.重做slave

2.找到历史的binlog文件,收到从binlog文件cp出需要的gtid集合日志在slave执行(这里需用到MySQLbinlog --include-gtids ),重新初始化从库的gtid_executed 的值


分享文章:启用auto_position=1一直报错
本文来源:http://cqcxhl.cn/article/pjogsg.html

其他资讯

在线咨询
服务热线
服务热线:028-86922220
TOP