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

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

posted @ 2017-05-09 12:44  王晓冬  阅读(851)  评论(0编辑  收藏  举报