2018年9月26日
9:25
现象:192.168.7.206、192.168.7.207互为双主,同步报错  1236
 
7.206现象如下
root@mysqldb 09:15  [mysql]> show slave status \G;
*************************** 1. row ***************************
               Slave_IO_State:
                  Master_Host: 192.168.7.207    --7.206的master主机为 7.207
                  Master_User: replusr
                  Master_Port: 3309
                Connect_Retry: 60
              Master_Log_File:  bin.000010
          Read_Master_Log_Pos: 234
               Relay_Log_File: slave-relay-bin.000001
                Relay_Log_Pos: 4
        Relay_Master_Log_File:  bin.000010
             Slave_IO_Running: No
            Slave_SQL_Running: Yes
              Replicate_Do_DB:
          Replicate_Ignore_DB:
           Replicate_Do_Table:
       Replicate_Ignore_Table:
      Replicate_Wild_Do_Table:
  Replicate_Wild_Ignore_Table:
                   Last_Errno: 0
                   Last_Error:
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 234
              Relay_Log_Space: 154
              Until_Condition: None
               Until_Log_File:
                Until_Log_Pos: 0
           Master_SSL_Allowed: No
           Master_SSL_CA_File:
           Master_SSL_CA_Path:
              Master_SSL_Cert:
            Master_SSL_Cipher:
               Master_SSL_Key:
        Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 1236
                Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file'
               Last_SQL_Errno: 0
               Last_SQL_Error:
  Replicate_Ignore_Server_Ids:
             Master_Server_Id: 207
                  Master_UUID: c4aff4f5-c097-11e8-b9e2-0050568d3207
             Master_Info_File: mysql.slave_master_info
                    SQL_Delay: 0
          SQL_Remaining_Delay: NULL
      Slave_SQL_Running_State: Slave has read all relay log; waiting for more updates
           Master_Retry_Count: 86400
                  Master_Bind:
      Last_IO_Error_Timestamp: 180925 18:00:51
     Last_SQL_Error_Timestamp:
               Master_SSL_Crl:
           Master_SSL_Crlpath:
           Retrieved_Gtid_Set:
            Executed_Gtid_Set: 232b5ddf-c098-11e8-af2d-0050568d4206:1-4,
232b5ddf-c098-11e8-af2d-0050568d4e69:1-5,
c4aff4f5-c097-11e8-b9e2-0050568d3207:2-4
                Auto_Position: 0
         Replicate_Rewrite_DB:
                 Channel_Name:
           Master_TLS_Version:
1 row in set (0.00 sec)
 
ERROR:
No query specified
7.207现象如下
root@mysqldb 09:16  [mysql]> show slave status \G;
*************************** 1. row ***************************
               Slave_IO_State:
                  Master_Host: 192.168.7.206        --7.207的master主机为 7.206
                  Master_User: replusr
                  Master_Port: 3309
                Connect_Retry: 60
              Master_Log_File:  bin.000011
          Read_Master_Log_Pos: 274
               Relay_Log_File: slave-relay-bin.000001
                Relay_Log_Pos: 4
        Relay_Master_Log_File:  bin.000011
             Slave_IO_Running: No
            Slave_SQL_Running: Yes
              Replicate_Do_DB:
          Replicate_Ignore_DB:
           Replicate_Do_Table:
       Replicate_Ignore_Table:
      Replicate_Wild_Do_Table:
  Replicate_Wild_Ignore_Table:
                   Last_Errno: 0
                   Last_Error:
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 274
              Relay_Log_Space: 154
              Until_Condition: None
               Until_Log_File:
                Until_Log_Pos: 0
           Master_SSL_Allowed: No
           Master_SSL_CA_File:
           Master_SSL_CA_Path:
              Master_SSL_Cert:
            Master_SSL_Cipher:
               Master_SSL_Key:
        Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 1236
                Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file'
               Last_SQL_Errno: 0
               Last_SQL_Error:
  Replicate_Ignore_Server_Ids:
             Master_Server_Id: 206
                  Master_UUID: 232b5ddf-c098-11e8-af2d-0050568d4206
             Master_Info_File: mysql.slave_master_info
                    SQL_Delay: 0
          SQL_Remaining_Delay: NULL
      Slave_SQL_Running_State: Slave has read all relay log; waiting for more updates
           Master_Retry_Count: 86400
                  Master_Bind:
      Last_IO_Error_Timestamp: 180925 18:01:32
     Last_SQL_Error_Timestamp:
               Master_SSL_Crl:
           Master_SSL_Crlpath:
           Retrieved_Gtid_Set:
            Executed_Gtid_Set: c4aff4f5-c097-11e8-b9e2-0050568d3207:1-4,
c4aff4f5-c097-11e8-b9e2-0050568d38d8:1-8
                Auto_Position: 0
         Replicate_Rewrite_DB:
                 Channel_Name:
           Master_TLS_Version:
1 row in set (0.00 sec)
分别在7.206、7.207关闭 slave并且刷新日志
 
7.206做stop slave、刷新日志等操作
 
 
root@mysqldb 09:15  [mysql]> stop slave;
Query OK, 0 rows affected (0.01 sec)
root@mysqldb 09:18  [mysql]> flush logs;
Query OK, 0 rows affected (0.01 sec)
再次确认日志刷新后的条目和位置
root@mysqldb 09:18  [mysql]> show master status \G;
*************************** 1. row ***************************
             File: bin.000012    --当前的日志条目
         Position: 274   --当前的日志位置
     Binlog_Do_DB:
 Binlog_Ignore_DB:
Executed_Gtid_Set: 232b5ddf-c098-11e8-af2d-0050568d4206:1-4,
232b5ddf-c098-11e8-af2d-0050568d4e69:1-5,
c4aff4f5-c097-11e8-b9e2-0050568d3207:2-4
1 row in set (0.00 sec)
 
 
 
 
7.207做stop slave、刷新日志等操作
root@mysqldb 09:15  [mysql]> stop slave;
Query OK, 0 rows affected (0.01 sec)
 
root@mysqldb 09:18  [mysql]> flush logs;
Query OK, 0 rows affected (0.01 sec)
 
root@mysqldb 09:18  [mysql]> show master status \G;
*************************** 1. row ***************************
             File: bin.000011   --当前的日志条目
         Position: 234    --当前的日志位置
     Binlog_Do_DB:
 Binlog_Ignore_DB:
Executed_Gtid_Set: c4aff4f5-c097-11e8-b9e2-0050568d3207:1-4,
c4aff4f5-c097-11e8-b9e2-0050568d38d8:1-8
1 row in set (0.00 sec)
 
 
7.206做change master 、start slave操作:
root@mysqldb 09:18  [mysql]> change master to master_log_file='bin.000011',master_log_pos=234;
Query OK, 0 rows affected (0.01 sec)
 
root@mysqldb 09:20  [mysql]> start slave;
Query OK, 0 rows affected (0.01 sec)
 
root@mysqldb 09:20  [mysql]> show slave status \G;
*************************** 1. row ***************************
               Slave_IO_State: Waiting for master to send event
                  Master_Host: 192.168.7.207
                  Master_User: replusr
                  Master_Port: 3309
                Connect_Retry: 60
              Master_Log_File: bin.000011
          Read_Master_Log_Pos: 234
               Relay_Log_File: slave-relay-bin.000002
                Relay_Log_Pos: 314
        Relay_Master_Log_File: bin.000011
             Slave_IO_Running: Yes
            Slave_SQL_Running: Yes
              Replicate_Do_DB:
          Replicate_Ignore_DB:
           Replicate_Do_Table:
       Replicate_Ignore_Table:
      Replicate_Wild_Do_Table:
  Replicate_Wild_Ignore_Table:
                   Last_Errno: 0
                   Last_Error:
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 234
              Relay_Log_Space: 521
              Until_Condition: None
               Until_Log_File:
                Until_Log_Pos: 0
           Master_SSL_Allowed: No
           Master_SSL_CA_File:
           Master_SSL_CA_Path:
              Master_SSL_Cert:
            Master_SSL_Cipher:
               Master_SSL_Key:
        Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
                Last_IO_Error:
               Last_SQL_Errno: 0
               Last_SQL_Error:
  Replicate_Ignore_Server_Ids:
             Master_Server_Id: 207
                  Master_UUID: c4aff4f5-c097-11e8-b9e2-0050568d3207
             Master_Info_File: mysql.slave_master_info
                    SQL_Delay: 0
          SQL_Remaining_Delay: NULL
      Slave_SQL_Running_State: Slave has read all relay log; waiting for more updates
           Master_Retry_Count: 86400
                  Master_Bind:
      Last_IO_Error_Timestamp:
     Last_SQL_Error_Timestamp:
               Master_SSL_Crl:
           Master_SSL_Crlpath:
           Retrieved_Gtid_Set:
            Executed_Gtid_Set: 232b5ddf-c098-11e8-af2d-0050568d4206:1-4,
232b5ddf-c098-11e8-af2d-0050568d4e69:1-5,
c4aff4f5-c097-11e8-b9e2-0050568d3207:2-4
                Auto_Position: 0
         Replicate_Rewrite_DB:
                 Channel_Name:
           Master_TLS_Version:
1 row in set (0.00 sec)
 
7.207做change master 、start slave操作:
root@mysqldb 09:19  [mysql]> change master to master_log_file='bin.000012',master_log_pos=274;
Query OK, 0 rows affected (0.00 sec)
 
root@mysqldb 09:20  [mysql]> start slave;
Query OK, 0 rows affected (0.01 sec)
 
root@mysqldb 09:21  [mysql]> show slave status \G;
*************************** 1. row ***************************
               Slave_IO_State: Waiting for master to send event
                  Master_Host: 192.168.7.206
                  Master_User: replusr
                  Master_Port: 3309
                Connect_Retry: 60
              Master_Log_File: bin.000012
          Read_Master_Log_Pos: 274
               Relay_Log_File: slave-relay-bin.000002
                Relay_Log_Pos: 314
        Relay_Master_Log_File: bin.000012
             Slave_IO_Running: Yes
            Slave_SQL_Running: Yes
              Replicate_Do_DB:
          Replicate_Ignore_DB:
           Replicate_Do_Table:
       Replicate_Ignore_Table:
      Replicate_Wild_Do_Table:
  Replicate_Wild_Ignore_Table:
                   Last_Errno: 0
                   Last_Error:
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 274
              Relay_Log_Space: 521
              Until_Condition: None
               Until_Log_File:
                Until_Log_Pos: 0
           Master_SSL_Allowed: No
           Master_SSL_CA_File:
           Master_SSL_CA_Path:
              Master_SSL_Cert:
            Master_SSL_Cipher:
               Master_SSL_Key:
        Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
                Last_IO_Error:
               Last_SQL_Errno: 0
               Last_SQL_Error:
  Replicate_Ignore_Server_Ids:
             Master_Server_Id: 206
                  Master_UUID: 232b5ddf-c098-11e8-af2d-0050568d4206
             Master_Info_File: mysql.slave_master_info
                    SQL_Delay: 0
          SQL_Remaining_Delay: NULL
      Slave_SQL_Running_State: Slave has read all relay log; waiting for more updates
           Master_Retry_Count: 86400
                  Master_Bind:
      Last_IO_Error_Timestamp:
     Last_SQL_Error_Timestamp:
               Master_SSL_Crl:
           Master_SSL_Crlpath:
           Retrieved_Gtid_Set:
            Executed_Gtid_Set: c4aff4f5-c097-11e8-b9e2-0050568d3207:1-4,
c4aff4f5-c097-11e8-b9e2-0050568d38d8:1-8
                Auto_Position: 0
         Replicate_Rewrite_DB:
                 Channel_Name:
           Master_TLS_Version:
1 row in set (0.00 sec)
 
ok,完美解决

MySQL-1236问题处理的更多相关文章

  1. 记一次mysql主从同步因断电产生的不能同步问题 1236 1032

    背景: 项目新上线一个月,qa需要测试断电服务拉起,服务拉起成功后,发现mysql主从异常,以下是发现的问题以及解决方案 问题1: Slave_IO_Running:  No 一方面原因是因为网络通信 ...

  2. MySQL Got fatal error 1236原因和解决方法【转】

    本文来自:http://blog.itpub.net/22664653/viewspace-1714269/ 一 前言  MySQL 的主从复制作为一项高可用特性,用于将主库的数据同步到从库,在维护主 ...

  3. 【MySQL】MySQL同步报错-> Last_IO_Error: Got fatal error 1236 from master when reading data from binary log

    这个报错网上搜索了一下,大部分是由于MySQL意外关闭或强制重启造成的binlog文件事务点读取异常造成的主从同步报错 Last_IO_Error: Got fatal error 1236 from ...

  4. mysql 主从 Got fatal error 1236 from master when reading data from binary log: 'Could not find first 错误

    本地MySQL环境,是两台MySQL做M-M复制.今天发现错误信息: mysql 5.5.28-log> show slave status\G ************************ ...

  5. MySQL主从失败 错误Got fatal error 1236解决方法

    --MySQL主从失败 错误Got fatal error 1236解决方法 ----------------------------------------------------2014/05/1 ...

  6. 解决mysql开启GTID主从同步出现1236错误问题【转】

    最近遇到mysql开启gtid做复制时,从库出现1236错误,导致同步无法进行,本文就这问题记录下处理步骤,有关gtid知识在这里不做介绍,mysql版本为5.7.16. 一.错误原因分析 错误信息如 ...

  7. mysql主从不同步问题 Error_code: 1236

    第一种情况,开启GTID,从库与主库不同步. 1.在从库上查看从的状态   mysql> show slave status \G *************************** 1. ...

  8. mysql主从同步失败Last_IO_Error: Got fatal error 1236 from master解决方法

    mysql教程主从同步失败Last_IO_Error: Got fatal error 1236 from master解决方法 遇到这样的错误如:“Last_IO_Error: Got fatal ...

  9. 解决mysql开启GTID主从同步出现1236错误问题

    解决mysql开启GTID主从同步出现1236错误问题     最近遇到mysql开启gtid做复制时,从库出现1236错误,导致同步无法进行,本文就这问题记录下处理步骤,有关gtid知识在这里不做介 ...

  10. MySQL案例09:Last_IO_Error: Got fatal error 1236 from master when reading data from binary log

    刚处理完“挖矿”事件,在做最后一个MySQL NBU备份的时候,发现从库有问题,好奇的是怎么主从状态异常没有告警呢?先不管这么多了,处理了这个问题再完善告警内容. 一.错误信息 从库show slav ...

随机推荐

  1. [HDU 2520] 我是菜鸟,我怕谁(不一样的for循环)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2520 //学学不一样的for循环 #include<iostream> #include& ...

  2. SQL Server 常见数据类型介绍

    数据表是由多个列组成,创建表时必须明确每个列的数据类型,以下列举SQL Server常见数据类型的使用规则,方便查阅. 整数类型 int 存储范围是-2,147,483,648到2,147,483,6 ...

  3. Google advertiser api开发概述——批量处理

    批处理 大多数服务都提供同步 API,要求您发出请求然后等待响应,但 BatchJobService 允许您对多项服务执行批量操作,而无需等待操作完成. 与各服务的特定 mutate 操作不同,Bat ...

  4. sticky-footer的三种解决方案

    在网页设计中,Sticky footers设计是最古老和最常见的效果之一,大多数人都曾经经历过.它可以概括如下:如果页面内容不够长的时候,页脚块粘贴在视窗底部:如果内容足够长时,页脚块会被内容向下推送 ...

  5. 转一个集成速锐的ss 回头试试 补充加速一、Vultr安装锐速

    https://liyuans.com/archives/ssr-serverspeeder-onekey.html Debian/Ubuntu 系统 ShadowsocksR 一键安装脚本 (集成锐 ...

  6. JaveWeb 公司项目(6)----- 通过ToolTip给控件添加动态注释

    现在公司的项目进展到了视屏这一块,关于海康网页端的构建我会另外写一篇博客来详细讲解,这一篇的博文主要讲的是我刚刚遇到的一个小问题 连接上了视屏之后,将控制按钮换成图标,方位按钮比较好理解,调焦调距的按 ...

  7. vs 2013 编译cocos2d-x-3.9

    下载地址:链接: https://pan.baidu.com/s/1IkQsMU6NoERAAQLcCUMcXQ 提取码: p1pb 下载完成后,解压 进入build 目录 使用vs 2013 打开工 ...

  8. 《剑指offer》第六十三题(股票的最大利润)

    // 面试题63:股票的最大利润 // 题目:假设把某股票的价格按照时间先后顺序存储在数组中,请问买卖交易该股 // 票可能获得的利润是多少?例如一只股票在某些时间节点的价格为{9, 11, 8, 5 ...

  9. ArcFace Android 人脸检测与人脸识别集成分享

    目前我们的应用内使用了 ArcFace 的人脸检测功能,其他的我们并不了解,所以这里就和大家分享一下我们的集成过程和一些使用心得集成ArcFace FD 的集成过程非常简单在 ArcFace FD 的 ...

  10. Tomcat部署项目定时任务跑了两次

    在server.xml下面找到Host这行代码 <Host name="localhost" appBase="webapps" unpackWARs=& ...