昨天收拾网卡今天收拾mha。
先解释下这个master_ip_failover脚本。这东西是mha4mysql-manager-0.55.tar.gz源码包里给的一个脚本,可以拿来用,但是要做一下修改。
做测试的时候尽量还是关了防火墙。否则各种找事儿(阻止了3306端口,虽然可以手动开放但是还是直接关了)
mha按照配置要求配完之后,abc三台机器。a是master bc是slave ,之后进行连通性检查和复制检查(在master上做)。结果在复制检查的时候报错
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).
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.cnf
就给过了
稍微了解了下。貌似master_ip_failover这个脚本里的一些内容是可以不用的,就是说删掉就可以。就像这次这个东西一样