Mysqlbinlog can not parse row based events

Source: Internet
Author: User
Tags mysql client

During the recent MHA test, the Mysqlbinlog client was hit with a version that was lower than the server version. This error tip: 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. This should be a more common mistake. This is mainly due to some version issues caused by the installation of MySQL-related RPM packages during installation of Linux, and later with the installation of a later version of MySQL. The following is the main description of the problem.

1, fault phenomenon
# MASTERHA_CHECK_REPL--CONF=/ETC/APP1.CNF
Mon Feb-20:46:12-[WARNING] Global configuration file/etc/masterha_default.cnf not found. Skipping.
Mon Feb 20:46:12-[INFO] Reading application default configuration from/etc/app1.cnf.
Mon Feb 20:46:12-[INFO] Reading server configuration from/etc/app1.cnf.
Mon Feb 20:46:12-[INFO] mha::mastermonitor version 0.56.
Mon Feb 20:46:13-[INFO] GTID Failover mode = 0
Mon Feb 20:46:13-[info] Dead Servers:
Mon Feb 20:46:13-[info] Alive Servers:
Mon Feb 20:46:13-[info] 192.168.1.6 (192.168.1.6:3306)
Mon Feb 20:46:13-[info] 192.168.1.7 (192.168.1.7:3306)
Mon Feb 20:46:13-[info] 192.168.1.8 (192.168.1.8:3306)
Mon Feb 20:46:13-[info] Alive Slaves:
Mon Feb 20:46:13-[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 20:46:13-[info] replicating from 192.168.1.6 (192.168.1.6:3306)
Mon Feb 20:46:13-[INFO] Primary candidate for the new Master (Candidate_master is set)
Mon Feb 20:46:13-[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 20:46:13-[info] replicating from 192.168.1.6 (192.168.1.6:3306)
Mon Feb 20:46:13-[INFO] current Alive master:192.168.1.6 (192.168.1.6:3306)
Mon Feb 20:46:13-[info] Checking slave configurations.
Mon Feb 20:46:13-[info] Read_only=1 is not set on slave 192.168.1.7 (192.168.1.7:3306).
Mon Feb 20:46:13-[WARNING] relay_log_purge=0 is not set on slave 192.168.1.7 (192.168.1.7:3306).
Mon Feb 20:46:13-[INFO] Checking replication filtering settings.
Mon Feb 20:46:13-[info] binlog_do_db=, binlog_ignore_db=
Mon Feb 20:46:13-[info] Replication filtering check OK.
Mon Feb 20:46:13-[info] GTID (with Auto-pos) was not supported
Mon Feb 20:46:13-[INFO] Starting SSH connection tests.
Mon Feb 20:46:14-[INFO] All SSH connection tests passed successfully.
Mon Feb 20:46:14-[info] Checking MHA Node version.
Mon Feb 20:46:15-[info] Version check OK.
Mon Feb 20:46:15-[info] Checking SSH publickey authentication settings on the current master.
Mon Feb 20:46:15-[info] healthcheck:ssh to 192.168.1.6 is reachable.
Mon Feb 20:46:16-[info] Master MHA Node version is 0.56.
Mon Feb 20:46:16-[INFO] Checking Recovery script configurations on 192.168.1.6 (192.168.1.6:3306):
Mon Feb 20:46:16-[info] executing command:save_binary_logs--command=test--start_pos=4--binlog_dir=/data/my SqlData
--output_file=/var/tmp/save_binary_logs_test--manager_version=0.56--start_file=mysql-bin.000010
Mon Feb 20:46:16-[info] connecting to[email protected] (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 20:46:16-[info] Binlog setting che CK done.
Mon Feb 20:46:16-[info] Checking SSH publickey authentication and Checking recovery script configurations on All Alive slave servers.
Mon Feb 20:46:16-[info]   executing command:apply_diff_relay_logs--command=test--slave_user= ' m Ha '--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 20:46:16-[info]   connecting to [email protected] (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 20:46:16-[error][/usr/lib/perl5/site_perl/5.8.8/mha/mastermonitor.pm, ln412] slaves settings Check fail ed!
Mon Feb-20:46:16-[error][/usr/lib/perl5/site_perl/5.8.8/mha/mastermonitor.pm, ln275] Slave configuration Failed.
Mon Feb 20:46:16-[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 20:46:16-[error][/usr/lib/perl5/site_perl/5.8.8/mha/mastermonitor.pm, ln691] error happened on Monitori ng servers.
Mon Feb 20:46:16-[INFO] Got exit code 1 (not master dead).

MySQL Replication Health is not ok!

2. Fault Analysis
# # #查看当前的的mysqlbinlog
# which Mysqlbinlog
/app/soft/mysql/bin/mysqlbinlog

# # #mysqbinlog的版本号, as follows 3.4
# Mysqlbinlog--version
Mysqlbinlog Ver 3.4 for Linux at x86_64

# # #查看缺省路径下是否存在mysqlbinlog, the following query does exist
# Ls-hltr/usr/bin/mysqlbinlog
-rwxr-xr-x 1 root root 97K 2013-01-23/usr/bin/mysqlbinlog

# # #查看缺省mysqlbinlog的版本号, the following is 3.2, in line with the fault description, the version is too low.
#/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, fault resolution
# # #直接使用软链的方式来使得MHA调用的mysqlbinlog版本为3. Version 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 package, if there is no MySQL instance under the default path, the following way
# 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

# # #注意, after uninstalling the default RPM package, the default my.cnf is copied to/etc/my.cnf.rpmsave and needs to be copied back.
# CP/ETC/MY.CNF.RPMSAVE/ETC/MY.CNF

4. Extension reference
Extract binary logs using Mysqlbinlog
MySQL suppresses the binlog part of the Binlog log

Mysqlbinlog can not parse row based events

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.