MySQL主从复制报错如下:

2018-04-11 09:11:16 2400 [Note] Slave SQL thread initialized, starting replication in log 'binlog.000042' at position 1934531, relay log '/mysql/data/relay_bin.000053' position: 1934691
2018-04-11 09:11:16 2400 [ERROR] Error in Log_event::read_log_event(): 'Event too small', data_len: 0, event_type: 0
2018-04-11 09:11:16 2400 [ERROR] Error reading relay log event: slave SQL thread aborted because of I/O error
2018-04-11 09:11:16 2400 [ERROR] Slave SQL: 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. Error_code: 1594
2018-04-11 09:11:16 2400 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'binlog.000042' position 1934531

三台虚拟机做的MHA主从复制,由于经常开关机导致会出现此类错误。如上所示:

We stopped at log 'binlog.000042' position 1934531

解决办法是直接在slave上执行如下命令:

stop slave;
reset slave all;
change master to master_host='192.168.20.70',master_user='rep',master_password='rep',master_log_file='binlog.000042',master_log_pos=1934531;
start slave;

就按报错所示的binlog和pos进行主从复制的重置,之后就可以正常运行。

出现此报错可能的原因:

如error日志中所显示的原因,可能是主库的binlog损坏或者从库的relaylog损坏,或者网络问题,导致主从复制异常中断,此时只要重新执行change master即可。但是极端情况下由主从各自实例恢复造成的不一致无法进行恢复,只能重做主从。

Error in Log_event::read_log_event(): 'Event too small', data_len: 0, event_type: 0的更多相关文章

  1. ERROR: Error in Log_event::read_log_event(): 'read error', data_len: 438, event_type: 2

    分析从库1062问题,解析从库binlog日志,报错如下 [root@xxxdb0402 tmp]# mysqlbinlog mysql-bin.004271 > 4.log ERROR: Er ...

  2. mysqlbinlog错误:Error in Log_event::read_log_event(): 'read error'

    环境: mysql 5.6 ; binlog  3.4 ; binlog_format MIXED ; .报错: mysqlbinlog -v --start-position=166084123 m ...

  3. ERROR: Error in Log_event::read_log_event(): 'Found invalid event in binary log', data_len: 31, event_type: 35报错处理

    centos7系统MySQL5.7在用mysqlbinlog命令查询binlog日志时刚开始查询即自动终止查询,查了一下该日志有300M,于是仔细看发现有报错,见下图: 在网上查找经验贴http:// ...

  4. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.mybatis.spring.mapper.MapperScannerConfigurer#0'

    七月 05, 2018 10:26:54 上午 org.apache.tomcat.util.digester.SetPropertiesRule begin警告: [SetPropertiesRul ...

  5. 07 oracle 归档模式 inactive/current redo log损坏修复--以及错误ORA-00600: internal error code, arguments: [2663], [0], [9710724], [0], [9711142], [], [], [], [], [], [], []

    07 oracle 归档模式 inactive/current redo log损坏修复--以及错误ORA-00600: internal error code, arguments: [2663], ...

  6. Java AOP nested exception is java.lang.NoClassDefFoundError: org/aopalliance/aop/Advice || Error creating bean with name 'org.springframework.aop.aspectj.AspectJPointcutAdvisor#0' 两个异常解决办法

    贴出applicationContext.xml <?xml version="1.0" encoding="UTF-8"?> <beans ...

  7. error LNK2038: 检测到“_ITERATOR_DEBUG_LEVEL”的不匹配项:值“0”不匹配值“2”

    error: vtkCommon.lib(vtkSmartPointerBase.obj) : error LNK2038: 检测到“_ITERATOR_DEBUG_LEVEL”的不匹配项:值“0”不 ...

  8. android sdk启动报错error: could not install *smartsocket* listener: cannot bind to 127.0.0.1:5037:

    android sdk启动报错error: could not install *smartsocket* listener: cannot bind to 127.0.0.1:5037: 问题原因: ...

  9. (原)error LNK2038: 检测到“_ITERATOR_DEBUG_LEVEL”的不匹配项: 值“0”不匹配值“2”

    转载请注明出处: http://www.cnblogs.com/darkknightzh/p/5577534.html 在debug下使用intel的mkl库时(release下无此问题),莫名的出现 ...

随机推荐

  1. 使用awk和sed获取文件奇偶数行的方法总结

    测试文件test.file [root@localhost ~]# cat test.file 111111111111111 222222222222222 333333333333333 4444 ...

  2. webservice的两种调用方式

    如下 using ConsoleApplication1.TestWebService; using System; using System.Collections; using System.Co ...

  3. 基于SpringMVC+Spring+MyBatis实现秒杀系统【概况】

    前言 本教程使用SpringMVC+Spring+MyBatis+MySQL实现一个秒杀系统.教程素材来自慕课网视频教程[https://www.imooc.com/learn/631].有感兴趣的可 ...

  4. QT 应用程序测试

    添加环境 export QTEDIR='/Qt5' export QTINC='/Qt5/include/' export QTLIB='/Qt5/lib' export QT_QPA_FB_TSLI ...

  5. [PHP] php + phpstudy + phpstrom + xdebug + postman开启调试

    主体 php + phpstudy + phpstrom + xdebug + postman + vue + chrome 使用的是前后端分离的开发方式,vue 在 webpack 通过代理进行请求 ...

  6. [转]Angular4 数据请求 POST、GET

    本文转自:https://blog.csdn.net/dailuwen/article/details/79375980 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog ...

  7. 分部视图(Partial View)及Html.Partial和Html.Action差异

    参考资料:  https://www.cnblogs.com/Leon-Hu/p/5575311.html

  8. 从零开始学安全(六)●黑客常用的Dos命令

    cd   文件路径                      要切换的路径cd \                                     直接回根目录dir              ...

  9. mybatis_08 mybatis与hibernate的区别

    这个问题常常被面试官当做面试题 mybatis与hibernate喜忧参半,各有特点 Mybatis技术特点: 好处: 1.  通过直接编写SQL语句,可以直接对SQL进行性能的优化: 2.  学习门 ...

  10. oracle的Date类型遇到MyBatis产生的坑

    坑描述: 公司的订单表数据量巨大(亿级),在进行查询的时候,发现一个慢查询. 背景: 数据库:oracle 表:T_order 索引字段:create_date  (字段类型 date) 慢查询sql ...