mysqlGTID主从同步出现1236错误问题

从主库xtrabackup备份,配置好gtid复制,从主库的从库复制。一直报错误

  

 Last_IO_Error: 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.'

 看了从库,保留有最近7天的binlog日志,怎么还有找不到binlog,查了一下,原来是主库的gtid和从库的gtid不一样

 主库gtid:

04cfe2d0-8709-11ea-993a-a4fa76fdf2a6:1-2316735354,
151ba254-8709-11ea-95a6-a4fa76fdf4b0:1,
2b02a6a4-18ba-11e9-bec1-e435c881d012:1-132,
5dc542a6-4627-11e9-a3e8-e435c881d116:1-28835327,
62cd3f43-53d4-11e9-9461-883fd358a4b0:1-61077414,
645f56c0-6e68-11e9-8951-18ded7a37b4a:1-232612455,
749003b7-909d-11e8-a759-9c37f402a633:1-143387296,
daf04b34-9b3e-11e9-a1fc-6c92bf487ed9:1-3546539260,
e7ae93d4-9b3e-11e9-ba88-6c92bf48c282:1,
f251b4f3-53cb-11ea-aeb1-a4fa76fdf372:1-982537851

 从库gtid

 

04cfe2d0-8709-11ea-993a-a4fa76fdf2a6:1-2344893812,
151ba254-8709-11ea-95a6-a4fa76fdf4b0:1,
2b02a6a4-18ba-11e9-bec1-e435c881d012:1-132,
3fd2272b-fc07-11e9-b7d7-6c92bf488712:1-3546,
5dc542a6-4627-11e9-a3e8-e435c881d116:1-28835327,
62cd3f43-53d4-11e9-9461-883fd358a4b0:1-61077414,
645f56c0-6e68-11e9-8951-18ded7a37b4a:1-232612455,
749003b7-909d-11e8-a759-9c37f402a633:1-143387296,
daf04b34-9b3e-11e9-a1fc-6c92bf487ed9:1-3546539260,
e7ae93d4-9b3e-11e9-ba88-6c92bf48c282:1,
ec4524cc-bd00-11e9-a6f6-246e9649a940:1,
f251b4f3-53cb-11ea-aeb1-a4fa76fdf372:1-982537851,
f88526bb-bd00-11e9-89ff-6c92bf482749:1-60

  如果再建一个级联从库,必须修改一下gtid值,因为gtid的唯一性:

     04cfe2d0-8709-11ea-993a-a4fa76fdf2a6:1-2316735354,  这块是不变的。要从库同步,需要修改gtid

  SET GLOBAL gtid_purged= 改成如下即可 :

04cfe2d0-8709-11ea-993a-a4fa76fdf2a6:1-2316735354,
151ba254-8709-11ea-95a6-a4fa76fdf4b0:1,
2b02a6a4-18ba-11e9-bec1-e435c881d012:1-132,
3fd2272b-fc07-11e9-b7d7-6c92bf488712:1-3546,
5dc542a6-4627-11e9-a3e8-e435c881d116:1-28835327,
62cd3f43-53d4-11e9-9461-883fd358a4b0:1-61077414,
645f56c0-6e68-11e9-8951-18ded7a37b4a:1-232612455,
749003b7-909d-11e8-a759-9c37f402a633:1-143387296,
daf04b34-9b3e-11e9-a1fc-6c92bf487ed9:1-3546539260,
e7ae93d4-9b3e-11e9-ba88-6c92bf48c282:1,
ec4524cc-bd00-11e9-a6f6-246e9649a940:1,
f251b4f3-53cb-11ea-aeb1-a4fa76fdf372:1-982537851,
f88526bb-bd00-11e9-89ff-6c92bf482749:1-60

  

posted @ 2020-09-01 10:29  zping  阅读(760)  评论(0编辑  收藏  举报