一、主从报错 Relay log read failure

问题原因,MySQL主从使用的是kvm虚拟机,物理机超分严重,在负载高的情况下会kill掉占用资源最多的虚拟机,再启动后导致主从失败

mysql> show slave status \G
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 192.168.0.8
Master_User: rsync
Master_Port: 3310
Connect_Retry: 60
Master_Log_File: mysql-bin.004772
Read_Master_Log_Pos: 850868066
Relay_Log_File: mysql-relay-bin.5326697
Relay_Log_Pos: 46202283
Relay_Master_Log_File: mysql-bin.004772
Slave_IO_Running: Yes
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: 516345810
Relay_Log_Space: 380726348
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: 0
Last_IO_Error:
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: 1
1 row in set (0.00 sec)

二、解决方法

在show slave status\G中找到如下信息,或者查看relay-log.info文件:
Relay_Master_Log_File: mysql-bin.004772 # slave库已读取的master的binlog
Exec_Master_Log_Pos: 516345810 # 在slave上已经执行的position位置点 停掉slave,以slave已经读取的binlog文件,和已经执行的position为起点,重新设置同步。
mysql> stop slave;
Query OK, 0 rows affected (0.08 sec) mysql> change master to master_host='192.168.0.8', master_user='rsync',master_password='d25tgb33edc',master_port=3306,master_log_file='mysql-bin.004772',master_log_pos=516345810;
Query OK, 0 rows affected (1.03 sec) mysql> start slave;
Query OK, 0 rows affected (0.41 sec)

MySQL主从报错1594的更多相关文章

  1. MySQL主从复制报错1594处理【转】

    一.问题描述 Mysql主从复制模式中,slave上报错 “relay log read failure”,导致主从同步停止. mysql> show slave status\G ****** ...

  2. MySQL主从报错解决:Failed to initialize the master info structure

    大清早收到一个MySQL的自定义语言告警 :replication interrupt,看来是主从同步报错了. 登陆MySQL,执行 show slave status \G 发现salve已经停止了 ...

  3. Mysql 主从报错:1141

    主从同步,从库报错代码:1141 ,错误信息如下: Master_Port: 3306 Connect_Retry: 60 Master_Log_File: binlog.000086 Read_Ma ...

  4. mysql主从报错截图

    1.首先确认报错的binlog和last event. 2.然后去主的机器上查看该报错的内容和报错的的位置,如果是结尾报错的,可以直接从新的binlog进行同步. #/mysql/logs# ../b ...

  5. MySQL主从-报错

    安装: 环境: 系统:centos7 x3 master:192.168.220.133 slave1:192.168.220.136 slave2:192.168.220.137 mysql服务器, ...

  6. 线上MYSQL同步报错故障处理总结(转)

    前言 在发生故障切换后,经常遇到的问题就是同步报错,数据库很小的时候,dump完再导入很简单就处理好了,但线上的数据库都150G-200G,如果用单纯的这种方法,成本太高,故经过一段时间的摸索,总结了 ...

  7. python 3.5.2安装mysql驱动报错

    python 3.5.2安装mysql驱动报错 python 3.5.2安装mysql驱动时出现如下异常: [root@localhost www]# pip install mysql-connec ...

  8. Loadrunner参数化连接oracle、mysql数据源报错及解决办法

    Loadrunner参数化连接oracle.mysql数据源报错及解决办法 (本人系统是Win7 64,  两位小伙伴因为是默认安装lr,安装在 最终参数化的时候,出现连接字符串无法自动加载出来: 最 ...

  9. 连接mysql数据库报错java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized...解决方法

    今天连接mysql数据库报错如下: java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized or r ...

随机推荐

  1. jquery 绑定事件 获取方式 --------------data event 获取

    //绑定事件 bind event $("body").on("click",function(){ console.log("in") } ...

  2. 目标管理之SMART原则

    SMART原则经常用于KPI制定,也可以用于个人目标管理. SMART原则: S(Specific):目标必须是具体的,需要对标特定的工作目标,不能笼统: M(Measurable):目标必须是可衡量 ...

  3. HTTP host头

    前几天,将一个host误配置为https,导致对方服务解析异常,排查半天,才发现是host导致,故整理一下HTTP host作用. Host:指定请求服务器的域名/IP地址和端口号. 作用:同一台机器 ...

  4. leveldb源码分析--SSTable之block

    在SSTable中主要存储数据的地方是data block,block_builder就是这个专门进行block的组织的地方,我们来详细看看其中的内容,其主要有Add,Finish和CurrentSi ...

  5. windows7环境下使用pip安装MySQLdb for python3.7

    1.首先,需要确定你已经安装了pip.在Python2.7的安装包中,easy_install.py和pip都是默认安装的.可以在Python的安装目录先确认,如果\Python37\Scripts里 ...

  6. centos 7 linux x64

    1.修改软件源 sudo wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo yum updat ...

  7. [Spark RDD_add_1] groupByKey & reduceBykey 的区别

    [groupByKey & reduceBykey 的区别] 在都能实现相同功能的情况下优先使用 reduceBykey Combine 是为了减少网络负载 1. groupByKey 是没有 ...

  8. xml的xsi:type序列化和反序列化

    最近在做HL7V3的对接,关于XML的序列化和反序列化遇到xsi:type的问题解决方法 实体类定义: public class HL7V3_ProviderOrganization { public ...

  9. jQ判断一个元素是否为空

    // 方法一 if (!$('#jb51').html()) { //http://www.jb51.net 什么都没有找到; } // 方法二 if ($('#jb51').is(":em ...

  10. 洛谷P4053 [JSOI2007]建筑抢修

    放题解 题目传送门 放代码 #include <bits/stdc++.h>//万能头 #define MAXN 150000//最多的建筑数量(数据范围) using namespace ...