忘记密码   免费注册 查看新帖 |

ChinaUnix.net

  平台 论坛 博客 文库 频道自动化运维 虚拟化 储存备份 C/C++ PHP MySQL 嵌入式 Linux系统
最近访问板块 发新帖
查看: 2527 | 回复: 1

[系统管理] mysql 5.6 Mha 问题 [复制链接]

论坛徽章:
0
发表于 2018-01-11 20:33 |显示全部楼层
各位网友好,因项目需要搭建mysql 5.6 MHA 在执行 masterha_check_ssh 顺利完成,
但执行masterha_check_repl 检查复制环境时报错

[root@mydb-master-active ~]# masterha_check_repl --conf=/etc/mha/app1.cnf
Thu Jan 11 20:27:58 2018 - [info] Reading default configuration from /etc/masterha_default.cnf..
Thu Jan 11 20:27:58 2018 - [info] Reading application default configuration from /etc/mha/app1.cnf..
Thu Jan 11 20:27:58 2018 - [info] Reading server configuration from /etc/mha/app1.cnf..
Thu Jan 11 20:27:58 2018 - [info] MHA::MasterMonitor version 0.56.
Thu Jan 11 20:27:58 2018 - [info] GTID failover mode = 0
Thu Jan 11 20:27:58 2018 - [info] Dead Servers:
Thu Jan 11 20:27:58 2018 - [info] Alive Servers:
Thu Jan 11 20:27:58 2018 - [info]   192.168.1.101(192.168.1.101:3306)
Thu Jan 11 20:27:58 2018 - [info]   192.168.1.102(192.168.1.102:3306)
Thu Jan 11 20:27:58 2018 - [info]   192.168.1.103(192.168.1.103:3306)
Thu Jan 11 20:27:58 2018 - [info]   192.168.1.104(192.168.1.104:3306)
Thu Jan 11 20:27:58 2018 - [info] Alive Slaves:
Thu Jan 11 20:27:58 2018 - [info]   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 - [info]     Replicating from 192.168.1.101(192.168.1.101:3306)
Thu Jan 11 20:27:58 2018 - [info]     Primary candidate for the new Master (candidate_master is set)
Thu Jan 11 20:27:58 2018 - [info]   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 - [info]     Replicating from 192.168.1.101(192.168.1.101:3306)
Thu Jan 11 20:27:58 2018 - [info]     Primary candidate for the new Master (candidate_master is set)
Thu Jan 11 20:27:58 2018 - [info]   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 - [info]     Replicating from 192.168.1.101(192.168.1.101:3306)
Thu Jan 11 20:27:58 2018 - [info]     Primary candidate for the new Master (candidate_master is set)
Thu Jan 11 20:27:58 2018 - [info] Current Alive Master: 192.168.1.101(192.168.1.101:3306)
Thu Jan 11 20:27:58 2018 - [info] Checking slave configurations..
Thu Jan 11 20:27:58 2018 - [info]  read_only=1 is not set on slave 192.168.1.102(192.168.1.102:3306).
Thu Jan 11 20:27:58 2018 - [warning]  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 - [info]  read_only=1 is not set on slave 192.168.1.103(192.168.1.103:3306).
Thu Jan 11 20:27:58 2018 - [warning]  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 - [info]  read_only=1 is not set on slave 192.168.1.104(192.168.1.104:3306).
Thu Jan 11 20:27:58 2018 - [warning]  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 - [info] Checking replication filtering settings..
Thu Jan 11 20:27:58 2018 - [info]  binlog_do_db= , binlog_ignore_db=
Thu Jan 11 20:27:58 2018 - [info]  Replication filtering check ok.
Thu Jan 11 20:27:58 2018 - [info] GTID (with auto-pos) is not supported
Thu Jan 11 20:27:58 2018 - [info] Starting SSH connection tests..
Thu Jan 11 20:28:01 2018 - [info] All SSH connection tests passed successfully.
Thu Jan 11 20:28:01 2018 - [info] Checking MHA Node version..
Thu Jan 11 20:28:01 2018 - [info]  Version check ok.
Thu Jan 11 20:28:01 2018 - [info] Checking SSH publickey authentication settings on the current master..
Thu Jan 11 20:28:01 2018 - [info] HealthCheck: SSH to 192.168.1.101 is reachable.
Thu Jan 11 20:28:01 2018 - [info] Master MHA Node version is 0.56.
Thu Jan 11 20:28:01 2018 - [info] Checking recovery script configurations on 192.168.1.101(192.168.1.101:3306)..
Thu Jan 11 20:28:01 2018 - [info]   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 - [info]   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 - [info] Binlog setting check done.
Thu Jan 11 20:28:01 2018 - [info] Checking SSH publickey authentication and checking recovery script configurations on all alive slave servers..
Thu Jan 11 20:28:01 2018 - [info]   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 - [info]   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 - [info]   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 - [info]   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 - [info]   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 - [info]   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 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln205] Slaves settings check failed!
Thu Jan 11 20:28:02 2018 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln413] Slave configuration failed.
Thu Jan 11 20:28:02 2018 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln424] Error happened on checking configurations.  at /usr/bin/masterha_check_repl line 48
Thu Jan 11 20:28:02 2018 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln523] Error happened on monitoring servers.
Thu Jan 11 20:28:02 2018 - [info] Got exit code 1 (Not master dead).

MySQL Replication Health is NOT OK!

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

论坛徽章:
33
荣誉会员
日期:2011-11-23 16:44:17天秤座
日期:2014-08-26 16:18:20天秤座
日期:2014-08-29 10:12:18丑牛
日期:2014-08-29 16:06:45丑牛
日期:2014-09-03 10:28:58射手座
日期:2014-09-03 16:01:17寅虎
日期:2014-09-11 14:24:21天蝎座
日期:2014-09-17 08:33:55IT运维版块每日发帖之星
日期:2016-04-17 06:23:27操作系统版块每日发帖之星
日期:2016-04-18 06:20:00IT运维版块每日发帖之星
日期:2016-04-24 06:20:0015-16赛季CBA联赛之天津
日期:2016-05-06 12:46:59
发表于 2018-01-12 16:12 |显示全部楼层
回复 1# jiezai3800

Thu Jan 11 20:28:02 2018 - [info]   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

您需要登录后才可以回帖 登录 | 注册

本版积分规则

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号 北京市公安局海淀分局网监中心备案编号:11010802020122
广播电视节目制作经营许可证(京) 字第1234号 中国互联网协会会员  联系我们:wangnan@it168.com
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP