zoukankan      html  css  js  c++  java
  • mysqlG基于TID模式同步报错 (Last_IO_Errno: 1236)

    mysqlG基于TID模式同步报错
    Last_IO_Errno: 1236

    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.'
    ---------------------
    一般两种情况会出现以上现象

    1.在主库上手动执行清除二进制日志文件

    2.主库重启,重新同步时

    解决如下:
    1.查看主|从库
    show global variables like '%gtid%';
    记录主库:gtid_purged值
    记录从库: gtid_executed值 已执行过事物
    在从库上也执行该命令,查看gtid_purged值是否和主库相同,如果小于主库的值如下

    2.从库执行
    mysql>stop slave ;
    mysql>reset slave all;
    mysql>reset master;
    在从库上重新设置gtid_purged
    该值有两个来源,一是在主库上查询的gtid_purged,二是在从库上查询的已经执行过的gtid_executed值(本机的就不需要,主库上gtid)
    注意:一定记得加上从库上已经执行过的gtid,若只设置了主库上的gtid_purged,此时从库会重新拉取主库上所有的二进制日志文件,同步过程会出现其他错误,导致同步无法进行

    注意设置gtid_purged值时,gtid_executed值必须为空否则报错,该值清空的方法就是reset  master命令
    mysql>set global gtid_purged=主库gtid_purged+从库gtid_executed; 逗号分隔主,从  重新执行主库
    mysql>CHANGE MASTER TO
    MASTER_HOST='ip',
    MASTER_PORT=port,
    MASTER_USER='user',
    MASTER_PASSWORD='password',
    MASTER_AUTO_POSITION = 1;
    mysql>start slave;
    mysql>show slave status G

    原文:https://blog.csdn.net/csao204282/article/details/54582597 

  • 相关阅读:
    Mac保留Python2安装Python3(Anaconda3)
    Mybatis Plugin 以及Druid Filer 改写SQL
    Jackson替换fastjson
    Java单元测试 Http Server Mock框架选型
    应用中有多个Spring Property PlaceHolder导致@Value只能获取到默认值
    RabbitMQ Policy的使用
    Collectors.toMap不允许Null Value导致NPE
    php 删除标签
    php 替换标签
    jquery拼接html
  • 原文地址:https://www.cnblogs.com/zhs0/p/10528707.html
Copyright © 2011-2022 走看看