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

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;

异常关机,同时出现:Last_IO_Errno: 1236,Last_SQL_Errno: 1594的更多相关文章

  1. Last_IO_Errno: 1236 Last_IO_Error: Got fatal error 1236 from master when reading data from binary lo

    mysql> show slave status\G *************************** 1. row ***************************         ...

  2. VM virtuaBox异常关机启动不了的解决方案

    事件回放 我的物理机是win7,上面装了一个VM virtualBox,用来装Centos,有天物理机非正常关闭,导致VM virtuaBox异常关机启动不了,如下: 确实找不到这个vm_liang. ...

  3. mysql因为服务器异常关机倒是启动不了 找不到mysql.sock

    今天mysql服务器突然异常关机,查看云平台发现该vm处于为开机状态切状态是无法启动,经过协调, 服务器启动了.但是进行service mysql start 启动时.提示错误: Starting M ...

  4. Linux异常关机后,Mysql启动出错ERROR 2002 (HY000)

    Linux异常关机后,Mysql启动或訪问时,出错: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/ ...

  5. # vmware异常关机后,虚拟系统无法启动的解决办法

    vmware异常关机后,虚拟系统无法启动的解决办法 先使用everything搜索所有后缀为.lck的文件,这些文件全部删除,如果不确定是否可以删除,先把这些文件转移到桌面,等能启动虚拟系统之后再删除 ...

  6. 1、通过CP数据文件的方式恢复MySQL 从库 启动后报错:Last_IO_Errno: 1236:A slave with the same server_uuid/server_id as this slave has connected to the master;

    1.问题: MySQL从库中查看主从状态: show slave status\G,发现出现IO的报错: Last_IO_Errno: Last_IO_Error: Got fatal error f ...

  7. mysqlG基于TID模式同步报错 (Last_IO_Errno: 1236)

    mysqlG基于TID模式同步报错Last_IO_Errno: 1236 Last_IO_Error: Got fatal error 1236 from master when reading da ...

  8. 解决一次gitlab因异常关机导致启动失败

    解决一次gitlab因异常关机导致启动失败 目录 解决一次gitlab因异常关机导致启动失败 1. 服务器异常关机 2. gitlab服务 2.1 进入gitlab容器内部 2.2 检查gitlab各 ...

  9. android studio异常关机后出现的问题

      使用android studio 时突然卡死. 重启后所有项目都打不开,提示workspace.xml  Error:content is not allowed in prolog 打开work ...

随机推荐

  1. 【Java】Java中charAt()方法的使用

    说明 java.lang.String.charAt() 方法返回指定索引处的char值.索引范围是从0到length() - 1.对于数组索引,序列的第一个char值是在索引为0,索引1,依此类推 ...

  2. Sklearn----使用决策树预测隐形眼镜类型

    import pandas as pd import pydotplus from sklearn.externals.six import StringIO #LabelEncoder:将字符串转换 ...

  3. ubuntu18.04英文环境解决各种软件中文乱码问题

    如果要同时支持中文也支持英文,进入到该软件的字体设置界面,字体格式选择为: Noto Sans CJK SC

  4. oracle12.2 CDB PDB基本管理操作

    容器间切换 切换到对应的PDBSSQL> alter session set container=pdb1;Session altered.SQL> alter database open ...

  5. Delphi中Tlist实例

    http://blog.163.com/jiandande3218@126/blog/static/74728469201132721428194/ Delphi中Tlist实例 2011-04-27 ...

  6. java 虚方法。 后面new 那个类, 就调用哪个类的方法 ,而非定义类的方案。 关于父子 类的 呵呵

    java   虚方法.     后面new  那个类, 就调用哪个类的方法 ,而非定义类的方案.  关于父子 类的   呵呵 在多态的情况下,声明为父类类型的引用变量只能调用父类中的方法,但如果此变量 ...

  7. python实现获取文件夹中的最新文件

    实现代码如下: #查找某目录中的最新文件import osclass FindNewFile: def find_NewFile(self,path): #获取文件夹中的所有文件 lists = os ...

  8. tensorflow学习框架(炼数成金网络版学习记录)

    chapter1 #变量 import tensorflow as tf x = tf.Variable([1,2]) a = tf.constant([3,3]) #增加一个减法op sub = t ...

  9. docker hub 本地镜像登录

    docker的登录信息存放在home目录下的.docker文件夹下,查看 cat ~/.docker/config.json { "auths": { "gcyimgs. ...

  10. MySql-第七篇单表查询

    1.MySQL中可以使用+.-.*./. 1>但MySQL中没有提供字符串连接运算符,可以使用concat(a_str,'xxx')进行连接. 2>在算术表达式中使用null,将会导致整个 ...