Mysqlbinlog can not parse row based events, mysqlbinlogparse

Source: Internet
Author: User

Mysqlbinlog can not parse row based events, mysqlbinlogparse

During the recent MHA test, the version of the mysqlbinlog client is lower than that of the server. The error message is mysqlbinlog is 3.2 (encoded 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 common error. This is mainly because mysql-related rpm packages are usually installed on your own during Linux installation, and later versions of mysql are installed on higher versions. The following describes the problem.

 

1. Fault
# 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 invocations ..
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 deployments 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 deployments 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 (encoded in MySQL Client 5.0 or lower). This is not recommended. Consider upgrading MySQL Client to 5.1 or higher.
Mysqlbinlog is 3.2 (encoded 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. Fault Analysis
### View the current mysqlbinlog
# Which mysqlbinlog
/App/soft/mysql/bin/mysqlbinlog

### Mysqbinlog version, which is 3.4
# Mysqlbinlog -- version
Mysqlbinlog Ver 3.4 for Linux at x86_64

### Check whether mysqlbinlog exists in the default path. The following query does exist:
# Ls-hltr/usr/bin/mysqlbinlog
-Rwxr-xr-x 1 root 97 K 2013-01-23/usr/bin/mysqlbinlog

### View the default version number of mysqlbinlog, Which is 3.2, which is consistent 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. troubleshooting
### Directly use soft links to set the mysqlbinlog version called by MHA to version 3.4
# Mv/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

### You can also uninstall the current mysql rpm package of the system. If there is no mysql instance in the default path, follow these steps:
# 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

### Note: After the default rpm package is uninstalled, 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
Use mysqlbinlog to extract binary logs
Binlog section in BINLOG suppression by MySQL

Related Article

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.