MHA报错:mysqlbinlog: unknown variable 'default-character-set=utf8mb4'

MHA报错:mysqlbinlog: unknown variable ‘default-character-set=utf8mb4’

问题说明

进行mha的repl检测时报错:

[root@mysql02 ~]# masterha_check_repl --conf=/etc/masterha/app1.cnf
Tue Jun 11 11:32:42 2019 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Tue Jun 11 11:32:42 2019 - [info] Reading application default configuration from /etc/masterha/app1.cnf..
Tue Jun 11 11:32:42 2019 - [info] Reading server configuration from /etc/masterha/app1.cnf..
Tue Jun 11 11:32:42 2019 - [info] MHA::MasterMonitor version 0.56.
Tue Jun 11 11:32:43 2019 - [info] GTID failover mode = 0
Tue Jun 11 11:32:43 2019 - [info] Dead Servers:
Tue Jun 11 11:32:43 2019 - [info] Alive Servers:
Tue Jun 11 11:32:43 2019 - [info]   10.176.140.11(10.176.140.11:3306)
Tue Jun 11 11:32:43 2019 - [info]   10.176.140.18(10.176.140.18:3306)
Tue Jun 11 11:32:43 2019 - [info]   10.176.140.17(10.176.140.17:3306)
Tue Jun 11 11:32:43 2019 - [info] Alive Slaves:
Tue Jun 11 11:32:43 2019 - [info]   10.176.140.18(10.176.140.18:3306)  Version=5.6.36-log (oldest major version between slaves) log-bin:enabled
Tue Jun 11 11:32:43 2019 - [info]     Replicating from 10.176.140.11(10.176.140.11:3306)
Tue Jun 11 11:32:43 2019 - [info]   10.176.140.17(10.176.140.17:3306)  Version=5.6.36-log (oldest major version between slaves) log-bin:enabled
Tue Jun 11 11:32:43 2019 - [info]     Replicating from 10.176.140.11(10.176.140.11:3306)
Tue Jun 11 11:32:43 2019 - [info] Current Alive Master: 10.176.140.11(10.176.140.11:3306)
Tue Jun 11 11:32:43 2019 - [info] Checking slave configurations..
Tue Jun 11 11:32:43 2019 - [warning]  relay_log_purge=0 is not set on slave 10.176.140.18(10.176.140.18:3306).
Tue Jun 11 11:32:43 2019 - [warning]  relay_log_purge=0 is not set on slave 10.176.140.17(10.176.140.17:3306).
Tue Jun 11 11:32:43 2019 - [info] Checking replication filtering settings..
Tue Jun 11 11:32:43 2019 - [info]  binlog_do_db= , binlog_ignore_db= 
Tue Jun 11 11:32:43 2019 - [info]  Replication filtering check ok.
Tue Jun 11 11:32:43 2019 - [info] GTID (with auto-pos) is not supported
Tue Jun 11 11:32:43 2019 - [info] Starting SSH connection tests..
Tue Jun 11 11:32:46 2019 - [info] All SSH connection tests passed successfully.
Tue Jun 11 11:32:46 2019 - [info] Checking MHA Node version..
Tue Jun 11 11:32:47 2019 - [info]  Version check ok.
Tue Jun 11 11:32:47 2019 - [info] Checking SSH publickey authentication settings on the current master..
SSH warring: Authorized users only. All activity may be monitored and reported 
Tue Jun 11 11:32:47 2019 - [info] HealthCheck: SSH to 10.176.140.11 is reachable.
Tue Jun 11 11:32:47 2019 - [info] Master MHA Node version is 0.56.
Tue Jun 11 11:32:47 2019 - [info] Checking recovery script configurations on 10.176.140.11(10.176.140.11:3306)..
Tue Jun 11 11:32:47 2019 - [info]   Executing command: save_binary_logs --command=test --start_pos=4 --binlog_dir=/app/log --output_file=/var/tmp/save_binary_logs_test --manager_version=0.56 --start_file=mysql-bin.000006 
Tue Jun 11 11:32:47 2019 - [info]   Connecting to [email protected](10.176.140.11:22).. 
SSH warring: Authorized users only. All activity may be monitored and reported 
  Creating /var/tmp if not exists..    ok.
  Checking output directory is accessible or not..
   ok.
  Binlog found at /app/log, up to mysql-bin.000006
Tue Jun 11 11:32:48 2019 - [info] Binlog setting check done.
Tue Jun 11 11:32:48 2019 - [info] Checking SSH publickey authentication and checking recovery script configurations on all alive slave servers..
Tue Jun 11 11:32:48 2019 - [info]   Executing command : apply_diff_relay_logs --command=test --slave_user='root' --slave_host=10.176.140.18 --slave_ip=10.176.140.18 --slave_port=3306 --workdir=/var/tmp --target_version=5.6.36-log --manager_version=0.56 --relay_log_info=/app/data/relay-log.info  --relay_dir=/app/data/  --slave_pass=xxx
Tue Jun 11 11:32:48 2019 - [info]   Connecting to [email protected](10.176.140.18:22).. 
SSH warring: Authorized users only. All activity may be monitored and reported 
mysqlbinlog: unknown variable 'default-character-set=utf8mb4'
mysqlbinlog version command failed with rc 7:0, please verify PATH, LD_LIBRARY_PATH, and client options
 at /usr/bin/apply_diff_relay_logs line 493.
Tue Jun 11 11:32:48 2019 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln205] Slaves settings check failed!
Tue Jun 11 11:32:48 2019 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln413] Slave configuration failed.
Tue Jun 11 11:32:48 2019 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln424] Error happened on checking configurations.  at /usr/bin/masterha_check_repl line 48.
Tue Jun 11 11:32:48 2019 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln523] Error happened on monitoring servers.
Tue Jun 11 11:32:48 2019 - [info] Got exit code 1 (Not master dead).

MySQL Replication Health is NOT OK!

这个问题导致MHA无法启动,判断原因如下:

mysqlbinlog: unknown variable 'default-character-set=utf8mb4'
mysqlbinlog version command failed with rc 7:0, please verify PATH, LD_LIBRARY_PATH, and client options
 at /usr/bin/apply_diff_relay_logs line 493.

问题分析

错误是由于mysqlbinlog命令无法读取配置信息:default-character-set=utf8mb4
导致masterha_check_repl脚本中的mysqlbinlog命令执行失败。

直接注释掉my.cnf中的default-character-set=utf8mb4配置即可。如需指定utf8字符集,可使用配置:

[mysqld]
character-set-server = utf8mb4
发布了136 篇原创文章 · 获赞 58 · 访问量 36万+

猜你喜欢

转载自blog.csdn.net/sunbocong/article/details/91420282