mysqlbinlog can not parse row based events

    最近的MHA测试过程中,碰到了mysqlbinlog客户端的版本低于服务端版本的问题。即这个错误提示:mysqlbinlog is 3.2 (included in MySQL Client 5.0 or lower), but MySQL server version is 5.6.22-log. mysqlbinlog can not parse row based events。这个应该是个比较常见的错误。主要是由于在安装Linux期间通常在自带安装mysql相关rpm包,后来又安装了高版本的mysql而引发的一些版本问题。下面是这个问题的主要描述。

 

1、故障现象
# masterha_check_repl --conf=/etc/app1.cnf
Mon Feb 16 20:46:12 2015 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Mon Feb 16 20:46:12 2015 - [info] Reading application default configuration from /etc/app1.cnf..
Mon Feb 16 20:46:12 2015 - [info] Reading server configuration from /etc/app1.cnf..
Mon Feb 16 20:46:12 2015 - [info] MHA::MasterMonitor version 0.56.
Mon Feb 16 20:46:13 2015 - [info] GTID failover mode = 0
Mon Feb 16 20:46:13 2015 - [info] Dead Servers:
Mon Feb 16 20:46:13 2015 - [info] Alive Servers:
Mon Feb 16 20:46:13 2015 - [info]   192.168.1.6(192.168.1.6:3306)
Mon Feb 16 20:46:13 2015 - [info]   192.168.1.7(192.168.1.7:3306)
Mon Feb 16 20:46:13 2015 - [info]   192.168.1.8(192.168.1.8:3306)
Mon Feb 16 20:46:13 2015 - [info] Alive Slaves:
Mon Feb 16 20:46:13 2015 - [info]   192.168.1.7(192.168.1.7:3306)  Version=5.6.22-log (oldest major version between slaves) log-bin:enabled
Mon Feb 16 20:46:13 2015 - [info]     Replicating from 192.168.1.6(192.168.1.6:3306)
Mon Feb 16 20:46:13 2015 - [info]     Primary candidate for the new Master (candidate_master is set)
Mon Feb 16 20:46:13 2015 - [info]   192.168.1.8(192.168.1.8:3306)  Version=5.6.22-log (oldest major version between slaves) log-bin:enabled
Mon Feb 16 20:46:13 2015 - [info]     Replicating from 192.168.1.6(192.168.1.6:3306)
Mon Feb 16 20:46:13 2015 - [info] Current Alive Master: 192.168.1.6(192.168.1.6:3306)
Mon Feb 16 20:46:13 2015 - [info] Checking slave configurations..
Mon Feb 16 20:46:13 2015 - [info]  read_only=1 is not set on slave 192.168.1.7(192.168.1.7:3306).
Mon Feb 16 20:46:13 2015 - [warning]  relay_log_purge=0 is not set on slave 192.168.1.7(192.168.1.7:3306).
Mon Feb 16 20:46:13 2015 - [info] Checking replication filtering settings..
Mon Feb 16 20:46:13 2015 - [info]  binlog_do_db= , binlog_ignore_db=
Mon Feb 16 20:46:13 2015 - [info]  Replication filtering check ok.
Mon Feb 16 20:46:13 2015 - [info] GTID (with auto-pos) is not supported
Mon Feb 16 20:46:13 2015 - [info] Starting SSH connection tests..
Mon Feb 16 20:46:14 2015 - [info] All SSH connection tests passed successfully.
Mon Feb 16 20:46:14 2015 - [info] Checking MHA Node version..
Mon Feb 16 20:46:15 2015 - [info]  Version check ok.
Mon Feb 16 20:46:15 2015 - [info] Checking SSH publickey authentication settings on the current master..
Mon Feb 16 20:46:15 2015 - [info] HealthCheck: SSH to 192.168.1.6 is reachable.
Mon Feb 16 20:46:16 2015 - [info] Master MHA Node version is 0.56.
Mon Feb 16 20:46:16 2015 - [info] Checking recovery script configurations on 192.168.1.6(192.168.1.6:3306)..
Mon Feb 16 20:46:16 2015 - [info]   Executing command: save_binary_logs --command=test --start_pos=4 --binlog_dir=/data/mysqldata
   --output_file=/var/tmp/save_binary_logs_test --manager_version=0.56 --start_file=mysql-bin.000010
Mon Feb 16 20:46:16 2015 - [info]   Connecting to root@192.168.1.6(192.168.1.6:22)..
  Creating /var/tmp if not exists..    ok.
  Checking output directory is accessible or not..
   ok.
  Binlog found at /data/mysqldata, up to mysql-bin.000010
Mon Feb 16 20:46:16 2015 - [info] Binlog setting check done.
Mon Feb 16 20:46:16 2015 - [info] Checking SSH publickey authentication and checking recovery script configurations on all alive slave servers..
Mon Feb 16 20:46:16 2015 - [info]   Executing command : apply_diff_relay_logs --command=test --slave_user='mha' --slave_host=192.168.1.7
  --slave_ip=192.168.1.7 --slave_port=3306 --workdir=/var/tmp --target_version=5.6.22-log --manager_version=0.56
  --relay_log_info=/data/mysqldata/relay-log.info  --relay_dir=/data/mysqldata/  --slave_pass=xxx
Mon Feb 16 20:46:16 2015 - [info]   Connecting to root@192.168.1.7(192.168.1.7:22)..
mysqlbinlog version is 3.2 (included in MySQL Client 5.0 or lower). This is not recommended. Consider upgrading MySQL Client to 5.1 or higher.
mysqlbinlog is 3.2 (included in MySQL Client 5.0 or lower), but MySQL server version is 5.6.22-log. mysqlbinlog can not parse row based events.
  Terminating script for safety reasons. at /usr/bin/apply_diff_relay_logs line 493
Mon Feb 16 20:46:16 2015 - [error][/usr/lib/perl5/site_perl/5.8.8/MHA/MasterMonitor.pm, ln412] Slaves settings check failed!
Mon Feb 16 20:46:16 2015 - [error][/usr/lib/perl5/site_perl/5.8.8/MHA/MasterMonitor.pm, ln275] Slave configuration failed.
Mon Feb 16 20:46:16 2015 - [error][/usr/lib/perl5/site_perl/5.8.8/MHA/MasterMonitor.pm, ln520] Error happened on checking configurations. 
  at /usr/bin/masterha_check_repl line 48
Mon Feb 16 20:46:16 2015 - [error][/usr/lib/perl5/site_perl/5.8.8/MHA/MasterMonitor.pm, ln691] Error happened on monitoring servers.
Mon Feb 16 20:46:16 2015 - [info] Got exit code 1 (Not master dead).

MySQL Replication Health is NOT OK!

 

2、故障分析
###查看当前的的mysqlbinlog
# which mysqlbinlog
/app/soft/mysql/bin/mysqlbinlog

###mysqbinlog的版本号,如下为3.4
# mysqlbinlog --version
mysqlbinlog Ver 3.4 for Linux at x86_64

###查看缺省路径下是否存在mysqlbinlog,如下查询的确存在
# ls -hltr /usr/bin/mysqlbinlog
-rwxr-xr-x 1 root root 97K 2013-01-23 /usr/bin/mysqlbinlog

###查看缺省mysqlbinlog的版本号,如下为3.2,与故障描述相符,版本过低。
# /usr/bin/mysqlbinlog --version
/usr/bin/mysqlbinlog Ver 3.2 for redhat-linux-gnu at x86_64

### Author : Leshami
### Blog   : http://blog.csdn.net/leshami

 

3、故障解决
###直接使用软链的方式来使得MHA调用的mysqlbinlog版本为3.4版
# mv /usr/bin/mysqlbinlog /usr/bin/mysqlbinlog.bk
# ln -s /app/soft/mysql/bin/mysqlbinlog /usr/bin/mysqlbinlog
# /usr/bin/mysqlbinlog --version
/usr/bin/mysqlbinlog Ver 3.4 for Linux at x86_64

###也可以卸载系统当前的mysql rpm包,如果缺省路径下无mysql实例的话,如下方式
# rpm -qa|grep mysql
mysql-5.0.95-5.el5_9
# rpm -e --nodeps mysql-5.0.95-5.el5_9
warning: /etc/my.cnf saved as /etc/my.cnf.rpmsave
# more /etc/my.cnf
/etc/my.cnf: No such file or directory

###注意,卸载缺省的rpm包之后,缺省的my.cnf被复制为/etc/my.cnf.rpmsave,需要复制回去。
# cp /etc/my.cnf.rpmsave /etc/my.cnf

 

4、延伸参考
   使用mysqlbinlog提取二进制日志   MySQL抑制binlog日志中的BINLOG部分

时间: 2024-08-30 15:22:36

mysqlbinlog can not parse row based events的相关文章

MySQL MHA配置常见问题

    MHA在MySQL数据库中被广泛使用,它小巧易用,功能强大,实现了基于MySQL replication架构的自手动主从故障转移,从库重定向到主库并自动同步.尽管如此,在部署配置的过程中,由于疏忽总难以避免这样或那样的错误.本文是对MHA配置中常见问题的一个汇总,供大家参考.   1.非root用户等效性环境等效性配置  a.添加所有节点(含管理节点)主机名及IP到host文件,所有节点操作  b.生成基于非root用户(如使用mysql账户)的对称密钥,使用ssh-keygen  c.

ganglia gweb events or "user defined markers"

在说gweb的event 前, 我先举个例子 :  在办公室有时会听到NOC的同事大喊, 流量飙升了, 怎么回事? 然后一般会有同事回应可能是在跨机房拷贝一些文件或者数据什么的, 又或者是在做跨机房的数据备份什么的. 如果在流量图上有标记的话, 那么NOC的同事对待这种流量突变的情况也不会一惊一乍. gweb支持配置event, 这里指的event就是用户定义的时间段标签. 例如 :  配置文件目录和customize view的目录一样 http://blog.163.com/digoal@1

MySQL对数据库数据进行复制的基本过程详解_Mysql

复制      复制是从一个MySQL服务器(master)将数据拷贝到另外一台或多台MySQL服务器(slaves)的过程.复制是异步进行的--slaves服务器不需要持续地保持连接来接收master的数据.依据配置的不同,可以复制所有数据库,或指定的数据库,甚至是某一数据库指定的表.      使用复制功能的目的在于: 向外扩展的解决方案 -- 通过在多台服务器之间分散负载来提高性能.在这种环境下,所有写和更新操作都在master服务器上进行,而读操作则发生在一台或多台slaves服务器上.

【整理】MySQL 复制的工作方式

      写这篇文章的原因是,看到开源中国上的一篇投稿翻译文章,其中很多地方被翻译的错误百出.所以还是将原文保存在下面供参考吧. master 上写 binlog 是相对轻量的动作(顺序写+会被缓存到操作系统缓存里,轻量与否和磁盘同步设置相关): slave 在主从复制中跟随很紧的情况下,会直接从 master 所在操作系统缓存中读出 binlog 事件:若在几小时或几天后才进行同步则将导致 master 进行读盘操作,耗费相应的 IO 资源: Master_Log_File/Read_Mas

如何基于MySQL及Redis搭建统一的kv存储服务 | 秦波

一.MySQL+Redis常用部署方式 1.1  拓扑 1.2  特点 业务层通过双写同时写MySQL及Redis.读通常在Redis,若读取不到,则从MySQL读取,然后将数据同步到Redis,Redis通常设置expire或者默认LRU进行数据淘汰. 这种使用方式会有如下问题: 1)MySQL及Redis存在数据不一致风险,尤其是长时间运行的系统 2)业务层需要处理MySQL sql schema与Redis kv数据结构上的逻辑差异 3)无统一运维 4)无法方便扩容/缩容 二.KV化的存储

转一个dataTable的使用

学习可参考:http://www.guoxk.com/node/jquery-datatables http://yuemeiqing2008-163-com.iteye.com/blog/2006942 1:导入包: URL:http://www.datatables.net/ 分别导入css和js文件 Html代码 收藏代码 <style type="text/css" title="currentStyle"> @import "css/

Winform 调用WCF客户端,所有服务端方法在运行的时候均找不到(编译没有问题)

  今天在开发过程中遇到了一个很恶心的问题,就是Form窗体ShowDialog的时候,直接报出下面的错误: 有关调用实时(JIT)调试而不是此对话框的详细信息, 请参见此消息的结尾. ************** 异常文本 ************** System.MissingMethodException: 找不到方法:"XXX.XXX.DataObject.SPI.DataObjectColumn[] XXX.XXX.WCFClient.WCFService.ServiceClient

用模板实现代码和页面的分离

模板|页面 为了避免ASP程序和HTML代码混写造成维护困难的情况,本文介绍了一种方法,利用模板来分离程序和页面,使程序设计更加轻松. 在使用ASP制作一个站点的时候,常常会出现一个ASP文件中,程序代码和HTML代码混合的情况.这样子做有许多缺点: 1. 且不说编程时就要对页面布局进行设计和编排,造成代码混乱难懂,不规范: 2. 当需要改变页面外观时,你不仅要改变HTML部份,也需要改变ASP代码,不易维护. 那么,要如何才能避免这些麻烦呢? 答案就是使用模板文件,将ASP代码和HTML页面分

探讨:关于Asp中代码与页面的分离

页面 为了避免ASP程序和HTML代码混写造成维护困难的情况,本文介绍了一种方法,利用模板来分离程序和页面,使程序设计更加轻松.在使用ASP制作一个站点的时候,常常会出现一个ASP文件中,程序代码和HTML代码混合的情况.这样子做有许多缺点:1.且不说编程时就要对页面布局进行设计和编排,造成代码混乱难懂,不规范:2.当需要改变页面外观时,你不仅要改变HTML部份,也需要改变ASP代码,不易维护.那么,要如何才能避免这些麻烦呢?答案就是使用模板文件,将ASP代码和HTML页面分开,一切问题就都解决