zoukankan      html  css  js  c++  java
  • 搭建MHA问题汇总

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

    [root@node4 ~]# 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 root@192.168.56.27(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).

    解决办法: (所有节点)

    [root@node2 ~]# which mysqlbinlog
    /usr/local/mysql/bin/mysqlbinlog

    [root@node2 ~]# ln -s /usr/local/mysql/bin/mysqlbinlog /usr/bin/mysqlbinlog

    [root@node2 ~]# which mysql
     /usr/local/mysql/bin/mysql

    [root@node2 ~]# ln -s /usr/local/mysql/bin/mysql /usr/local/bin/mysql 

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

    [root@node4 ~]# 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

    [root@node4 ~]# 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 root@192.168.56.27(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).

    解决办法:

    [root@node2 ~]# which mysql
    /usr/local/mysql/bin/mysql
    [root@node2 ~]# ln -s /usr/local

    解决办法: (所有节点)

    [root@node2 ~]# which mysqlbinlog
    /usr/local/mysql/bin/mysqlbinlog

    [root@node2 ~]# ln -s /usr/local/mysql/bin/mysqlbinlog /usr/bin/mysqlbinlog

    [root@node2 ~]# which mysql
     /usr/local/mysql/bin/mysql

    [root@node2 ~]# ln -s /usr/local/mysql/bin/mysql /usr/local/bin/mysql 


    /mysql/bin/mysql /usr/bin/mysql

    4,Sun Mar 12 23:25:56 2017 - [error][/usr/share/perl5/vendor_perl/MHA/ServerManager.pm, ln301] Got MySQL error when connecting 192.168.56.27(192.168.56.27:3306) :1045:Access denied for user 'myha'@'node2' (using password: YES), but this is not a MySQL crash. Check MySQL server settings.

     
    原因:账号授权原因。
     
    解决办法:
    检查用户表 select user,host ,password from mysql.user;
     
    重新授权即可。
     
     
    5.[root@testdb ~]# rpm -ivh perl-Parallel-ForkManager-1.18-2.el7.src.rpm --nodeps
    warning: perl-Parallel-ForkManager-1.18-2.el7.src.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
    Updating / installing...
       1:perl-Parallel-ForkManager-1.18-2.################################# [100%]
    warning: user mockbuild does not exist - using root
    warning: group mockbuild does not exist - using root
    warning: user mockbuild does not exist - using root
    warning: group mockbuild does not exist - using root
     
    解决办法:useradd -s /sbin/nologin mockbuil
     
    6.[root@fmdvhadp04 ~]# masterha_check_repl --conf=/usr/local/masterha_work/conf/mha_total.cnf
    Can't locate Class/Load.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/share/perl5/vendor_perl/Log/Dispatch.pm line 12.
    BEGIN failed--compilation aborted at /usr/share/perl5/vendor_perl/Log/Dispatch.pm line 12.
    Compilation failed in require at /usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm line 28.
    BEGIN failed--compilation aborted at /usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm line 28.
    Compilation failed in require at /usr/bin/masterha_check_repl line 25.
    BEGIN failed--compilation aborted at /usr/bin/masterha_check_repl line 25.
     
    解决办法:
    yum install perl-Class-Load -y
     
     
     
  • 相关阅读:
    BZOJ 1951: [Sdoi2010]古代猪文( 数论 )
    BZOJ 1176: [Balkan2007]Mokia( CDQ分治 + 树状数组 )
    BZOJ 1066: [SCOI2007]蜥蜴( 最大流 )
    BZOJ 1935: [Shoi2007]Tree 园丁的烦恼( 差分 + 离散化 + 树状数组 )
    BZOJ 1297: [SCOI2009]迷路( dp + 矩阵快速幂 )
    BZOJ 1406: [AHOI2007]密码箱( 数论 )
    BZOJ 1876: [SDOI2009]SuperGCD( 更相减损 + 高精度 )
    spfa2
    spfa
    bellmanford队列优化
  • 原文地址:https://www.cnblogs.com/l10n/p/7631435.html
Copyright © 2011-2022 走看看