ssh免登录检测和复制环境检测显示已通过,但是启动报错?

来源:5-17 MHA架构实例演示(2)

雪兔儿

2020-05-17

[root@bogon ~]# masterha_manager --conf=/etc/mha/mysql_mha.cnf
Sun May 17 18:15:00 2020 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Sun May 17 18:15:00 2020 - [info] Reading application default configuration from /etc/mha/mysql_mha.cnf…
Sun May 17 18:15:00 2020 - [info] Reading server configuration from /etc/mha/mysql_mha.cnf…

IN SCRIPT TESTroot|sudo /sbin/ifconfig ens33:1 downroot|sudo /sbin/ifconfig ens33:1 192.168.118.90/24=

Use of uninitialized value $command in string eq at /usr/bin/master_ip_failover line 42.

报错但是我的虚拟IP设置了啊。
ifconfig ens33:1 192.168.118.90/24
ens33:1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.118.90 netmask 255.255.255.0 broadcast 192.168.118.255
ether 00:0c:29:9f:39:e7 txqueuelen 1000 (Ethernet)

这是复制环境检测的内容:

[root@bogon ~]# sudo masterha_check_repl --conf=/etc/mha/mysql_mha.cnf
Sun May 17 20:03:27 2020 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Sun May 17 20:03:27 2020 - [info] Reading application default configuration from /etc/mha/mysql_mha.cnf…
Sun May 17 20:03:27 2020 - [info] Reading server configuration from /etc/mha/mysql_mha.cnf…
Sun May 17 20:03:27 2020 - [info] MHA::MasterMonitor version 0.57.
Sun May 17 20:03:28 2020 - [info] GTID failover mode = 1
Sun May 17 20:03:28 2020 - [info] Dead Servers:
Sun May 17 20:03:28 2020 - [info] Alive Servers:
Sun May 17 20:03:28 2020 - [info] 192.168.118.139(192.168.118.139:3306)
Sun May 17 20:03:28 2020 - [info] 192.168.118.141(192.168.118.141:3306)
Sun May 17 20:03:28 2020 - [info] 192.168.118.140(192.168.118.140:3306)
Sun May 17 20:03:28 2020 - [info] Alive Slaves:
Sun May 17 20:03:28 2020 - [info] 192.168.118.141(192.168.118.141:3306) Version=5.7.30-log (oldest major version between slaves) log-bin:enabled
Sun May 17 20:03:28 2020 - [info] GTID ON
Sun May 17 20:03:28 2020 - [info] Replicating from 192.168.118.139(192.168.118.139:3306)
Sun May 17 20:03:28 2020 - [info] Primary candidate for the new Master (candidate_master is set)
Sun May 17 20:03:28 2020 - [info] 192.168.118.140(192.168.118.140:3306) Version=5.7.30-log (oldest major version between slaves) log-bin:enabled
Sun May 17 20:03:28 2020 - [info] GTID ON
Sun May 17 20:03:28 2020 - [info] Replicating from 192.168.118.139(192.168.118.139:3306)
Sun May 17 20:03:28 2020 - [info] Not candidate for the new Master (no_master is set)
Sun May 17 20:03:28 2020 - [info] Current Alive Master: 192.168.118.139(192.168.118.139:3306)
Sun May 17 20:03:28 2020 - [info] Checking slave configurations…
Sun May 17 20:03:28 2020 - [info] Checking replication filtering settings…
Sun May 17 20:03:28 2020 - [info] binlog_do_db= , binlog_ignore_db=
Sun May 17 20:03:28 2020 - [info] Replication filtering check ok.
Sun May 17 20:03:28 2020 - [info] GTID (with auto-pos) is supported. Skipping all SSH and Node package checking.
Sun May 17 20:03:28 2020 - [info] Checking SSH publickey authentication settings on the current master…
Sun May 17 20:03:33 2020 - [warning] HealthCheck: Got timeout on checking SSH connection to 192.168.118.139! at /usr/share/perl5/vendor_perl/MHA/HealthCheck.pm line 342.
Sun May 17 20:03:33 2020 - [info]
192.168.118.139(192.168.118.139:3306) (current master)
±-192.168.118.141(192.168.118.141:3306)
±-192.168.118.140(192.168.118.140:3306)

Sun May 17 20:03:33 2020 - [info] Checking replication health on 192.168.118.141…
Sun May 17 20:03:33 2020 - [info] ok.
Sun May 17 20:03:33 2020 - [info] Checking replication health on 192.168.118.140…
Sun May 17 20:03:33 2020 - [info] ok.
Sun May 17 20:03:33 2020 - [info] Checking master_ip_failover_script status:
Sun May 17 20:03:33 2020 - [info] /usr/bin/master_ip_failover #可选 --command=status --ssh_user=root --orig_master_host=192.168.118.139 --orig_master_ip=192.168.118.139 --orig_master_port=3306

IN SCRIPT TESTroot|sudo /sbin/ifconfig ens33:1 downroot|sudo /sbin/ifconfig ens33:1 192.168.118.90/24=

Checking the Status of the script… OK
Sun May 17 20:03:34 2020 - [info] OK.
Sun May 17 20:03:34 2020 - [warning] shutdown_script is not defined.
Sun May 17 20:03:34 2020 - [info] Got exit code 0 (Not master dead).

MySQL Replication Health is OK.

写回答

2回答

sqlercn

2020-05-17

master_ip_failover 这个脚本报错了,提供一下这个脚本的内容吧。

0
5
雪兔儿
回复
sqlercn
master_ip_failover 这个脚本报错的原因也是因为/etc/mha/mysql_mha.cnf 里是这样写的 master_ip_failover #可选 程序自动把#可选做为参数所以报错的,后来去掉了就没问题了。可是新的问题是下面的脚本程序自动加的参数报错。这就不知道怎么解决了。-ping_type=SELECT
2020-05-18
共5条回复

雪兔儿

提问者

2020-05-18

master_ip_failover 这个脚本报错的原因也是因为/etc/mha/mysql_mha.cnf 里是这样写的

master_ip_failover    #可选

程序自动把#可选做为参数所以报错的,后来去掉了就没问题了。


0
0

MySQL提升课程 全面讲解MySQL架构设计

面面俱到讲解影响MySQL性能的各个因素,让MySQL架构了然于胸。

4431 学习 · 549 问题

查看课程