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

ChinaUnix.net

  平台 论坛 博客 认证专区 大话IT 徽章 文库 自测 下载 频道自动化运维 虚拟化 储存备份 C/C++ PHP MySQL 嵌入式 Linux系统
最近访问板块 发新帖
查看: 1425 | 回复: 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!

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

论坛徽章:
32
荣誉会员
日期:2011-11-23 16:44:17射手座
日期:2014-09-03 16:01:17天蝎座
日期:2014-08-21 17:18:48丑牛
日期:2014-08-29 16:06:45天秤座
日期:2014-08-29 10:12:18天秤座
日期:2014-08-26 16:18:20双子座
日期:2014-07-30 11:38:27寅虎
日期:2014-08-04 10:24:12IT运维版块每日发帖之星
日期: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

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

本版积分规则

DTCC2018购票6.8折优惠进行时

中国数据库技术大会是国内数据库及大数据领域规模最大、最受欢迎的技术交流盛会。 2018年5月10-12日,第九届中国数据库技术大会将如约而至。本届大会以“数领先机•智赢未来”为主题,设定2大主会场及20个技术专场,邀请来自国内外互联网、金融、教育等行业百余位技术专家,共同探讨Oracle、MySQL、NoSQL、大数据等领域的前瞻性热点话题与技术。
----------------------------------------
优惠时间:2018年2月13日前

报名链接>>
  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP