mha复制检查报错及解决过程


昨天收拾网卡今天收拾mha。mysql

先解释下这个master_ip_failover脚本。这东西是mha4mysql-manager-0.55.tar.gz源码包里给的一个脚本,能够拿来用,可是要作一下修改。sql

    作测试的时候尽可能仍是关了防火墙。不然各类找事儿(阻止了3306端口,虽然能够手动开放可是仍是直接关了)app

      mha按照配置要求配完以后,abc三台机器。a是master bc是slave ,以后进行连通性检查和复制检查(在master上作)。结果在复制检查的时候报错ssh


Wed Jun  7 15:36:33 2017 - [info] Checking replication health on 192.168..
Wed Jun  7 15:36:33 2017 - [info]  ok.
Wed Jun  7 15:36:33 2017 - [info] Checking replication health on 192.168..
Wed Jun  7 15:36:33 2017 - [info]  ok.
Wed Jun  7 15:36:33 2017 - [info] Checking master_ip_failover_script status:
Wed Jun  7 15:36:33 2017 - [info]   /etc/mha/script/master_ip_failover --command=status --ssh_user=root --orig_master_host=192.168.--orig_master_ip=192.168.--orig_master_port=3306
Bareword "FIXME_xxx" not allowed while "strict subs" in use at /etc/mha/script/master_ip_failover line 100.
Execution of /etc/mha/script/master_ip_failover aborted due to compilation errors.
Wed Jun  7 15:36:34 2017 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln226]  Failed to get master_ip_failover_script status with return code 255:0.
Wed Jun  7 15:36:34 2017 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln424] Error happened on checking configurations.  at /bin/masterha_check_repl line 48.
Wed Jun  7 15:36:34 2017 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln523] Error happened on monitoring servers.
Wed Jun  7 15:36:34 2017 - [info] Got exit code 1 (Not master dead).

MySQL Replication Health is NOT OK!


就从红字开始往下报错。上网查了这个问题,也没个解释。看日志的意思是后者在用的时候不容许前者出现,那就进脚本里找到这个给他屏蔽掉算了。测试

而后从新检查,使用命令是:masterha_check_repl --conf=/etc/mha/app1.cnfspa

就给过了3d

稍微了解了下。貌似master_ip_failover这个脚本里的一些内容是能够不用的,就是说删掉就能够。就像此次这个东西同样日志