搭建MHA问题汇总

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了搭建MHA问题汇总相关的知识,希望对你有一定的参考价值。

1,Can‘t exec "mysqlbinlog": No such file or directory at /usr/share/perl5/vendor_perl/MHA/BinlogManager.pm line 106.

[[email protected] ~]# masterha_check_repl --conf=/masterha_work/conf/mha_total.cnf
....省略若干....

......
Fri Oct 6 13:14:15 2017 - [info] Checking SSH publickey authentication and checking recovery script configurations on all alive slave servers..
Fri Oct 6 13:14:15 2017 - [info] Executing command : apply_diff_relay_logs --command=test --slave_user=‘mhauser‘ --slave_host=192.168.56.27 --slave_ip=192.168.56.27 --slave_port=3307 --workdir=/masterha_work/rmt_mysql_binlog_workdir --target_version=5.6.34-log --manager_version=0.56 --relay_log_info=/data/mysql/3307/data/relay-log.info --relay_dir=/data/mysql/3307/data/ --slave_pass=xxx
Fri Oct 6 13:14:15 2017 - [info] Connecting to [email protected](192.168.56.27:22)..
Can‘t exec "mysqlbinlog": No such file or directory at /usr/share/perl5/vendor_perl/MHA/BinlogManager.pm line 106.
mysqlbinlog version command failed with rc 1:0, please verify PATH, LD_LIBRARY_PATH, and client options
at /usr/bin/apply_diff_relay_logs line 493
Fri Oct 6 13:14:15 2017 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln205] Slaves settings check failed!
Fri Oct 6 13:14:15 2017 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln413] Slave configuration failed.
Fri Oct 6 13:14:15 2017 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln424] Error happened on checking configurations. at /usr/bin/masterha_check_repl line 48
Fri Oct 6 13:14:15 2017 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln523] Error happened on monitoring servers.
Fri Oct 6 13:14:15 2017 - [info] Got exit code 1 (Not master dead).

 

解决办法:

[[email protected] ~]# which mysqlbinlog
/usr/local/mysql/bin/mysqlbinlog

[[email protected] ~]# ln -s /usr/local/mysql/bin/mysqlbinlog /usr/bin/mysqlbinlog

 

2,User repl does not exist or does not have REPLICATION SLAVE privilege! Other slaves can not start replication from this host.

[[email protected] ~]# masterha_check_repl --conf=/masterha_work/conf/mha_total.cnf
....省略若干....

......

Fri Oct 6 13:11:05 2017 - [error][/usr/share/perl5/vendor_perl/MHA/Server.pm, ln393] 192.168.56.27(192.168.56.27:3307): User repl does not exist or does not have REPLICATION SLAVE privilege! Other slaves can not start replication from this host.
Fri Oct 6 13:11:05 2017 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln424] Error happened on checking configurations. at /usr/share/perl5/vendor_perl/MHA/ServerManager.pm line 1403
Fri Oct 6 13:11:05 2017 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln523] Error happened on monitoring servers.
Fri Oct 6 13:11:05 2017 - [info] Got exit code 1 (Not master dead).

MySQL Replication Health is NOT OK!

 

解决办法:

从库也创建repl用户。???此处有疑问。

 

3,Testing mysql connection and privileges..sh: mysql: command not found

[[email protected] ~]# masterha_check_repl --conf=/masterha_work/conf/mha_total.cnf
....省略若干....

......

Fri Oct 6 13:18:14 2017 - [info] Executing command : apply_diff_relay_logs --command=test --slave_user=‘mhauser‘ --slave_host=192.168.56.27 --slave_ip=192.168.56.27 --slave_port=3307 --workdir=/masterha_work/rmt_mysql_binlog_workdir --target_version=5.6.34-log --manager_version=0.56 --relay_log_info=/data/mysql/3307/data/relay-log.info --relay_dir=/data/mysql/3307/data/ --slave_pass=xxx
Fri Oct 6 13:18:14 2017 - [info] Connecting to [email protected](192.168.56.27:22)..
Checking slave recovery environment settings..
Opening /data/mysql/3307/data/relay-log.info ... ok.
Relay log found at /data/mysql/3307/data, up to relay-bin.000002
Temporary relay log file is /data/mysql/3307/data/relay-bin.000002
Testing mysql connection and privileges..sh: mysql: command not found
mysql command failed with rc 127:0!
at /usr/bin/apply_diff_relay_logs line 375
main::check() called at /usr/bin/apply_diff_relay_logs line 497
eval {...} called at /usr/bin/apply_diff_relay_logs line 475
main::main() called at /usr/bin/apply_diff_relay_logs line 120
Fri Oct 6 13:18:14 2017 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln205] Slaves settings check failed!
Fri Oct 6 13:18:14 2017 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln413] Slave configuration failed.
Fri Oct 6 13:18:14 2017 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln424] Error happened on checking configurations. at /usr/bin/masterha_check_repl line 48
Fri Oct 6 13:18:14 2017 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln523] Error happened on monitoring servers.
Fri Oct 6 13:18:14 2017 - [info] Got exit code 1 (Not master dead).

 

解决办法:

[[email protected] ~]# which mysql
/usr/local/mysql/bin/mysql
[[email protected] ~]# ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql

 







































以上是关于搭建MHA问题汇总的主要内容,如果未能解决你的问题,请参考以下文章

CentOS7搭建Oracle11gRAC问题汇总

交叉编译环境搭建问题汇总

Android 环境搭建资料及启动过程中问题汇总

HadoopSpark 集群环境搭建问题汇总

系统环境搭建问题汇总

ELK搭建过程中出现的问题与解决方法汇总