排错集锦:在MHA 的配置过程中masterha_check_repl -conf=/etc/masterha/app1.cnf 失败
Posted 遙遙背影暖暖流星
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了排错集锦:在MHA 的配置过程中masterha_check_repl -conf=/etc/masterha/app1.cnf 失败相关的知识,希望对你有一定的参考价值。
问题:配置MHA时候,测试主从复制
第一次:masterha_check_repl -conf=/etc/masterha/app1.cnf
Can't exec "mysqlbinlog": 没有那个文件或目录 at /usr/local/share/perl5/MHA/BinlogManager.pm line 106.
mysqlbinlog version command failed with rc 1:0, please verify PATH, LD_LIBRARY_PATH, and client options
at /usr/local/bin/apply_diff_relay_logs line 493.
Wed Jul 21 04:22:02 2021 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln208] Slaves settings check failed!
Wed Jul 21 04:22:02 2021 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln416] Slave configuration failed.
Wed Jul 21 04:22:02 2021 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln427] Error happened on checking configurations. at /usr/local/bin/masterha_check_repl line 48.
Wed Jul 21 04:22:02 2021 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln525] Error happened on monitoring servers.
Wed Jul 21 04:22:02 2021 - [info] Got exit code 1 (Not master dead).
MySQL Replication Health is NOT OK!
解决:将三台机器mysql的my.cnf的default-character-set=utf8注销掉
第二次:masterha_check_repl -conf=/etc/masterha/app1.cnf
Wed Jul 21 08:06:42 2021 - [info] /usr/local/bin/master_ip_failover --command= status --ssh_user=root --orig_master_host=192.168.100.7 --orig_master_ip=192.168 .100.7 --orig_master_port=3306
: 没有那个文件或目录
Wed Jul 21 08:06:42 2021 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln229] Failed to get master_ip_failover_script status with return code 127:0.
Wed Jul 21 08:06:42 2021 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln427] Error happened on checking configurations. at /usr/local/bin/masterha_ch eck_repl line 48.
Wed Jul 21 08:06:42 2021 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln525] Error happened on monitoring servers.
Wed Jul 21 08:06:42 2021 - [info] Got exit code 1 (Not master dead).
MySQL Replication Health is NOT OK!
显示没有那个文件目录
解决:创建文件manager.log
[root@manager ~]# mkdir -p /var/log/masterha/app1/
[root@manager ~]# touch /var/log/masterha/app1/manager.log
第三次:masterha_check_repl -conf=/etc/masterha/app1.cnf
再次报错
mysqlbinlog: [ERROR] unknown variable 'default-character-set=utf8'
mysqlbinlog version command failed with rc 7:0, please verify PATH, LD_LIBRARY_PATH, and client options
at /usr/local/bin/apply_diff_relay_logs line 493.
Wed Jul 21 04:31:38 2021 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln208] Slaves settings check failed!
Wed Jul 21 04:31:38 2021 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln416] Slave configuration failed.
Wed Jul 21 04:31:38 2021 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln427] Error happened on checking configurations. at /usr/local/bin/masterha_check_repl line 48.
Wed Jul 21 04:31:38 2021 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln525] Error happened on monitoring servers.
Wed Jul 21 04:31:38 2021 - [info] Got exit code 1 (Not master dead).
MySQL Replication Health is NOT OK!
方法:查询之前的/etc/masterha/app1.cnf
再次masterha_check_repl -conf=/etc/masterha/app1.cnf 成功!!
以上是关于排错集锦:在MHA 的配置过程中masterha_check_repl -conf=/etc/masterha/app1.cnf 失败的主要内容,如果未能解决你的问题,请参考以下文章
MHA报错合集~~Binlog setting check failed!和unknown variable ‘default-character-set=utf8‘