mysql replication health is not ok_mysql配置mha高可用防火墙未关闭报错

##########################################################################

l  问题背景:检查主从复制之后做高可用报错

[root@db03 oldboy]# masterha_check_repl --conf=/etc/mha/app1.cnf

Thu May  4 21:52:24 2017 - [info] GTID (with auto-pos) is supported. Skipping all SSH and Node package checking.

Thu May  4 21:52:24 2017 - [error][/usr/share/perl5/vendor_perl/MHA/ServerManager.pm, ln492]  Server 10.0.0.52(10.0.0.3306) is dead, but must be alive! Check server settings.

Thu May  4 21:52:24 2017 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln424] Error happened on checkinonfigurations.  at /usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm line 399

Thu May  4 21:52:24 2017 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln523] Error happened on monitor servers.

Thu May  4 21:52:24 2017 - [info] Got exit code 1 (Not master dead).

MySQL Replication Health is NOT OK!

###########################################################################

l  解决思路:

查看部署过程有没有操作失误

根据提示Server 10.0.0.52(10.0.0.3306) is dead, but must be alive! Check server settings.判断10.0.0.52服务器连接问题

l  查看日志:

[root@db03 mha]# tail -f /var/log/mha/app1/manager

Thu May  4 17:46:00 2017 - [info] Current Alive Master: 10.0.0.51(10.0.0.51:3306)

Thu May  4 17:46:00 2017 - [info] Checking slave configurations..

Thu May  4 17:46:00 2017 - [info] Checking replication filtering settings..

Thu May  4 17:46:00 2017 - [info]  binlog_do_db= , binlog_ignore_db=

Thu May  4 17:46:00 2017 - [info]  Replication filtering check ok.

Thu May  4 17:46:00 2017 - [info] GTID (with auto-pos) is supported. Skipping all SSH and Node package checking.

Thu May  4 17:46:00 2017 - [error][/usr/share/perl5/vendor_perl/MHA/ServerManager.pm, ln492]  Server 10.0.0.52(10.0.0.3306) is dead, but must be alive! Check server settings.

Thu May  4 17:46:00 2017 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln424] Error happened on checkinonfigurations.  at /usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm line 399

Thu May  4 17:46:00 2017 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln523] Error happened on monitor servers.

Thu May  4 17:46:00 2017 - [info] Got exit code 1 (Not master dead).

############################################################################l

############################################################################

l  解决方法:

关闭10.0.0.52防火墙

[root@db02 MHA]# /etc/init.d/iptables stop

iptables: Setting chains to policy ACCEPT: filter          [  OK  ]

iptables: Flushing firewall rules:                         [  OK  ]

iptables: Unloading modules:                               [  OK  ]

测试结果:

Thu May  4 21:52:55 2017 - [info] Checking replication health on 10.0.0.52..

Thu May  4 21:52:55 2017 - [info]  ok.

Thu May  4 21:52:55 2017 - [info] Checking replication health on 10.0.0.53..

Thu May  4 21:52:55 2017 - [info]  ok.

Thu May  4 21:52:55 2017 - [warning] master_ip_failover_script is not defined.

Thu May  4 21:52:55 2017 - [warning] shutdown_script is not defined.

Thu May  4 21:52:55 2017 - [info] Got exit code 0 (Not master dead).

[root@db03 oldboy]# masterha_check_repl --conf=/etc/mha/app1.cnf

MySQL Replication Health is OK.

[root@db03 oldboy]#

########################经验小结###############################

排除故障:

原因一:防火墙iptables

原因二:selinux Disabled

原因三:软连接

ln -s /application/mysql/bin/mysqlbinlog /usr/bin/mysqlbinlog

ln -s /application/mysql/bin/mysql /usr/bin/mysql

######################################################################

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值