zoukankan      html  css  js  c++  java
  • 异常关机,同时出现:Last_IO_Errno: 1236,Last_SQL_Errno: 1594

    一主两从的结构,由于异常关机,导致两个从库都出现如下问题:

    mysql> show slave status G;
    *************************** 1. row ***************************
                   Slave_IO_State: 
                      Master_Host: 192.168.56.110
                      Master_User: replica
                      Master_Port: 3306
                    Connect_Retry: 60
                  Master_Log_File: 561103306-bin.000007
              Read_Master_Log_Pos: 1250488
                   Relay_Log_File: mysqld-relay-bin.000002
                    Relay_Log_Pos: 1207291
            Relay_Master_Log_File: 561103306-bin.000007
                 Slave_IO_Running: No
                Slave_SQL_Running: No
                  Replicate_Do_DB: 
              Replicate_Ignore_DB: 
               Replicate_Do_Table: 
           Replicate_Ignore_Table: 
          Replicate_Wild_Do_Table: 
      Replicate_Wild_Ignore_Table: 
                       Last_Errno: 1594
                       Last_Error: Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's relay log is corrupted (you can check this by running 'mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave.
                     Skip_Counter: 0
              Exec_Master_Log_Pos: 1250488
                  Relay_Log_Space: 1207754
                  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: 'Client requested master to start replication from impossible position; the first event '561103306-bin.000007' at 1250488, the last event read from './561103306-bin.000007' at 4, the last byte read from './561103306-bin.000007' at 4.'
                   Last_SQL_Errno: 1594
                   Last_SQL_Error: Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's relay log is corrupted (you can check this by running 'mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave.
      Replicate_Ignore_Server_Ids: 
                 Master_Server_Id: 561103306
                      Master_UUID: 
                 Master_Info_File: /var/lib/mysql/master.info
                        SQL_Delay: 0
              SQL_Remaining_Delay: NULL
          Slave_SQL_Running_State: 
               Master_Retry_Count: 86400
                      Master_Bind: 
          Last_IO_Error_Timestamp: 141020 09:57:15
         Last_SQL_Error_Timestamp: 141020 09:57:15
                   Master_SSL_Crl: 
               Master_SSL_Crlpath: 
               Retrieved_Gtid_Set: 
                Executed_Gtid_Set: 
                    Auto_Position: 0
    1 row in set (0.00 sec)

    当着两个问题同时出现时,先处理后面一个(errno:1594) ,再处理(error:1236)

     Last_SQL_Errno: 1594的处理方法:

    mysql>stop slave ;

    mysql> change master to master_log_file ='561103306-bin.000007' ,master_log_pos = 1250488;

     Last_IO_Errno: 1236的处理方法:

    # mysqlbinlog  561103306-bin.000007  >yyf.log

    在yyf.log里面找离  1250488位置最近的事件,发现该日志最后一个pos是1248558,那就可以直接切到下一个log的开始位置即可:

    mysql> stop slave;

    mysql>  change master to master_log_file='561103306-bin.000008' ,master_log_pos=0;

  • 相关阅读:
    PetaPOCO 一对多 多对一 多对多
    PetaPoco使用要点
    MySQL_杭州北仓 12.3-12.7需求活动期间累计下单达到3天及以上的客户_20161212
    Python 2.7_Second_try_爬取阳光电影网_获取电影下载地址并写入文件 20161207
    Python 2.7_First_try_爬取阳光电影网_20161206
    MySQL计算销售员昨日各指标综合得分_20161206
    MySQL_关于用嵌套表计算的可以不用 20161205
    MySQL_财务统计各产品品类各城市上周收入毛利表_20161202
    借助取色工具ColorPix对Pycharm编辑器设定自己喜欢的代码颜色_20161202
    python2.7 爬虫_爬取小说盗墓笔记章节及URL并导入MySQL数据库_20161201
  • 原文地址:https://www.cnblogs.com/yiyuf/p/4104367.html
Copyright © 2011-2022 走看看