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

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;

最新文章

  1. 使用mvc时,在视图view中使用强类型视图,在web.config文件中添加命名空间namespace的引用不起作用,解决方法
  2. 【Java每日一题】20161206
  3. 【leetcode】Surrounded Regions(middle)☆
  4. FPGA学习笔记之格雷码、边沿检测、门控时钟
  5. Q: How could I use MATLAB interface for parameter selection?
  6. SGU 131.Hardwood floor
  7. 常用Firefox扩展
  8. 区块链之智能合约 solidity踩坑 --上篇
  9. Oracle数据库容量使用情况调查
  10. odoo中self的使用
  11. 网站响应式布局/网站自适应问题+rem、em、px、pt及网站字体大小设配
  12. BZOJ3160 万径人踪灭(FFT+manacher)
  13. GuavaCache学习笔记一:自定义LRU算法的缓存实现
  14. BI-LSTM and CRF using Keras
  15. SpringMVC学习笔记1
  16. PyCharm配置Python3开发环境
  17. 解题:USACO13FEB Taxi
  18. LEFT JOIN与RIGHT JOIN学习笔记
  19. python 超时异常处理
  20. Evercookie

热门文章

  1. linux运维、架构之路-数据库迁移
  2. MySQL修改密码方法汇总
  3. [CSP-S模拟测试]:不等式(数学)
  4. curry柯里化
  5. OpenCV笔记:pyrDown()函数和pryUp()函数的使用
  6. rem布局及响应式布局
  7. 用maven给SpringBoot项目打包
  8. python使用中遇到的一些问题
  9. P1970花匠
  10. Jenkins使用一:CentOS7安装Jenkins