jiezai3800 发表于 2018-01-11 20:33

mysql 5.6 Mha 问题

各位网友好,因项目需要搭建mysql 5.6 MHA 在执行 masterha_check_ssh 顺利完成,
但执行masterha_check_repl 检查复制环境时报错

# masterha_check_repl --conf=/etc/mha/app1.cnf
Thu Jan 11 20:27:58 2018 - Reading default configuration from /etc/masterha_default.cnf..
Thu Jan 11 20:27:58 2018 - Reading application default configuration from /etc/mha/app1.cnf..
Thu Jan 11 20:27:58 2018 - Reading server configuration from /etc/mha/app1.cnf..
Thu Jan 11 20:27:58 2018 - MHA::MasterMonitor version 0.56.
Thu Jan 11 20:27:58 2018 - GTID failover mode = 0
Thu Jan 11 20:27:58 2018 - Dead Servers:
Thu Jan 11 20:27:58 2018 - Alive Servers:
Thu Jan 11 20:27:58 2018 -    192.168.1.101(192.168.1.101:3306)
Thu Jan 11 20:27:58 2018 -    192.168.1.102(192.168.1.102:3306)
Thu Jan 11 20:27:58 2018 -    192.168.1.103(192.168.1.103:3306)
Thu Jan 11 20:27:58 2018 -    192.168.1.104(192.168.1.104:3306)
Thu Jan 11 20:27:58 2018 - Alive Slaves:
Thu Jan 11 20:27:58 2018 -    192.168.1.102(192.168.1.102:3306)Version=5.6.38-log (oldest major version between slaves) log-bin:enabled
Thu Jan 11 20:27:58 2018 -    Replicating from 192.168.1.101(192.168.1.101:3306)
Thu Jan 11 20:27:58 2018 -    Primary candidate for the new Master (candidate_master is set)
Thu Jan 11 20:27:58 2018 -    192.168.1.103(192.168.1.103:3306)Version=5.6.38-log (oldest major version between slaves) log-bin:enabled
Thu Jan 11 20:27:58 2018 -    Replicating from 192.168.1.101(192.168.1.101:3306)
Thu Jan 11 20:27:58 2018 -    Primary candidate for the new Master (candidate_master is set)
Thu Jan 11 20:27:58 2018 -    192.168.1.104(192.168.1.104:3306)Version=5.6.38-log (oldest major version between slaves) log-bin:enabled
Thu Jan 11 20:27:58 2018 -    Replicating from 192.168.1.101(192.168.1.101:3306)
Thu Jan 11 20:27:58 2018 -    Primary candidate for the new Master (candidate_master is set)
Thu Jan 11 20:27:58 2018 - Current Alive Master: 192.168.1.101(192.168.1.101:3306)
Thu Jan 11 20:27:58 2018 - Checking slave configurations..
Thu Jan 11 20:27:58 2018 - read_only=1 is not set on slave 192.168.1.102(192.168.1.102:3306).
Thu Jan 11 20:27:58 2018 - relay_log_purge=0 is not set on slave 192.168.1.102(192.168.1.102:3306).
Thu Jan 11 20:27:58 2018 - read_only=1 is not set on slave 192.168.1.103(192.168.1.103:3306).
Thu Jan 11 20:27:58 2018 - relay_log_purge=0 is not set on slave 192.168.1.103(192.168.1.103:3306).
Thu Jan 11 20:27:58 2018 - read_only=1 is not set on slave 192.168.1.104(192.168.1.104:3306).
Thu Jan 11 20:27:58 2018 - relay_log_purge=0 is not set on slave 192.168.1.104(192.168.1.104:3306).
Thu Jan 11 20:27:58 2018 - Checking replication filtering settings..
Thu Jan 11 20:27:58 2018 - binlog_do_db= , binlog_ignore_db=
Thu Jan 11 20:27:58 2018 - Replication filtering check ok.
Thu Jan 11 20:27:58 2018 - GTID (with auto-pos) is not supported
Thu Jan 11 20:27:58 2018 - Starting SSH connection tests..
Thu Jan 11 20:28:01 2018 - All SSH connection tests passed successfully.
Thu Jan 11 20:28:01 2018 - Checking MHA Node version..
Thu Jan 11 20:28:01 2018 - Version check ok.
Thu Jan 11 20:28:01 2018 - Checking SSH publickey authentication settings on the current master..
Thu Jan 11 20:28:01 2018 - HealthCheck: SSH to 192.168.1.101 is reachable.
Thu Jan 11 20:28:01 2018 - Master MHA Node version is 0.56.
Thu Jan 11 20:28:01 2018 - Checking recovery script configurations on 192.168.1.101(192.168.1.101:3306)..
Thu Jan 11 20:28:01 2018 -    Executing command: save_binary_logs --command=test --start_pos=4 --binlog_dir=/data/mysql/logs/binlog --output_file=/etc/mha/save_binary_logs_test --manager_version=0.56 --start_file=binlog.000006
Thu Jan 11 20:28:01 2018 -    Connecting to root@192.168.1.101(192.168.1.101:22)..
Creating /etc/mha if not exists..    ok.
Checking output directory is accessible or not..
   ok.
Binlog found at /data/mysql/logs/binlog, up to binlog.000006
Thu Jan 11 20:28:01 2018 - Binlog setting check done.
Thu Jan 11 20:28:01 2018 - Checking SSH publickey authentication and checking recovery script configurations on all alive slave servers..
Thu Jan 11 20:28:01 2018 -    Executing command : apply_diff_relay_logs --command=test --slave_user='root' --slave_host=192.168.1.102 --slave_ip=192.168.1.102 --slave_port=3306 --workdir=/etc/mha --target_version=5.6.38-log --manager_version=0.56 --relay_log_info=/data/mysql/logs/relaylog/relay-log.info--relay_dir=/data/mysql/data/--slave_pass=xxx
Thu Jan 11 20:28:01 2018 -    Connecting to root@192.168.1.102(192.168.1.102:22)..
Checking slave recovery environment settings..
    Opening /data/mysql/logs/relaylog/relay-log.info ... ok.
    Relay log found at /data/mysql/logs/relaylog, up to relaylog.000010
    Temporary relay log file is /data/mysql/logs/relaylog/relaylog.000010
    Testing mysql connection and privileges..Warning: Using a password on the command line interface can be insecure.
done.
    Testing mysqlbinlog output.. done.
    Cleaning up test file(s).. done.
Thu Jan 11 20:28:02 2018 -    Executing command : apply_diff_relay_logs --command=test --slave_user='root' --slave_host=192.168.1.103 --slave_ip=192.168.1.103 --slave_port=3306 --workdir=/etc/mha --target_version=5.6.38-log --manager_version=0.56 --relay_log_info=/data/mysql/logs/relaylog/relay-log.info--relay_dir=/data/mysql/data/--slave_pass=xxx
Thu Jan 11 20:28:02 2018 -    Connecting to root@192.168.1.103(192.168.1.103:22)..
Checking slave recovery environment settings..
    Opening /data/mysql/logs/relaylog/relay-log.info ... ok.
    Relay log found at /data/mysql/logs/relaylog, up to relaylog.000009
    Temporary relay log file is /data/mysql/logs/relaylog/relaylog.000009
    Testing mysql connection and privileges..Warning: Using a password on the command line interface can be insecure.
done.
    Testing mysqlbinlog output.. done.
    Cleaning up test file(s).. done.
Thu Jan 11 20:28:02 2018 -    Executing command : apply_diff_relay_logs --command=test --slave_user='root' --slave_host=192.168.1.104 --slave_ip=192.168.1.104 --slave_port=3306 --workdir=/etc/mha --target_version=5.6.38-log --manager_version=0.56 --relay_log_info=/data/mysql/logs/relaylog/relay-log.info--relay_dir=/data/mysql/data/--slave_pass=xxx
Thu Jan 11 20:28:02 2018 -    Connecting to root@192.168.1.104(192.168.1.104:22)..
Checking slave recovery environment settings..
    Opening /data/mysql/logs/relaylog/relay-log.info ... ok.
    Relay log found at /data/mysql/logs/relaylog, up to relaylog.000010
    Temporary relay log file is /data/mysql/logs/relaylog/relaylog.000010
    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
Thu Jan 11 20:28:02 2018 - Slaves settings check failed!
Thu Jan 11 20:28:02 2018 - Slave configuration failed.
Thu Jan 11 20:28:02 2018 - Error happened on checking configurations.at /usr/bin/masterha_check_repl line 48
Thu Jan 11 20:28:02 2018 - Error happened on monitoring servers.
Thu Jan 11 20:28:02 2018 - Got exit code 1 (Not master dead).

MySQL Replication Health is NOT OK!

搞了好久,一直未解决。请帮助 !!!

q1208c 发表于 2018-01-12 16:12

回复 1# jiezai3800

Thu Jan 11 20:28:02 2018 -    Connecting to root@192.168.1.104(192.168.1.104:22)..
Checking slave recovery environment settings..
    Opening /data/mysql/logs/relaylog/relay-log.info ... ok.
    Relay log found at /data/mysql/logs/relaylog, up to relaylog.000010
    Temporary relay log file is /data/mysql/logs/relaylog/relaylog.000010
    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

页: [1]
查看完整版本: mysql 5.6 Mha 问题