测试配置:测试集群环境 访问集群 测试高可用 修复故障服务器

3.1 问题

测试集群环境
访问集群
测试高可用
修复故障服务器

3.2 步骤

实现此案例需要按照如下步骤进行。

步骤一:测试集群环境

1)在管理主机,测试ssh配置

 [root@mgm57 ~]# masterha_check_ssh --conf=/etc/mha/app1.cnf //执行测试命令
Thu Jun 20 15:33:48 2019 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Thu Jun 20 15:33:48 2019 - [info] Reading application default configuration from /etc/mha/app1.cnf..
Thu Jun 20 15:33:48 2019 - [info] Reading server configuration from /etc/mha/app1.cnf..
Thu Jun 20 15:33:48 2019 - [info] Starting SSH connection tests..
Thu Jun 20 15:33:49 2019 - [debug]
Thu Jun 20 15:33:48 2019 - [debug]  Connecting via SSH from [email protected](192.168.4.51:22) to [email protected](192.168.4.52:22)..
Thu Jun 20 15:33:49 2019 - [debug]   ok.
Thu Jun 20 15:33:49 2019 - [debug]  Connecting via SSH from [email protected](192.168.4.51:22) to [email protected](192.168.4.53:22)..
Thu Jun 20 15:33:49 2019 - [debug]   ok.
Thu Jun 20 15:33:50 2019 - [debug]
Thu Jun 20 15:33:49 2019 - [debug]  Connecting via SSH from [email protected](192.168.4.52:22) to [email protected](192.168.4.51:22)..
Thu Jun 20 15:33:49 2019 - [debug]   ok.
Thu Jun 20 15:33:49 2019 - [debug]  Connecting via SSH from [email protected](192.168.4.52:22) to [email protected](192.168.4.53:22)..
Thu Jun 20 15:33:49 2019 - [debug]   ok.
Thu Jun 20 15:33:50 2019 - [debug]   ok.
Thu Jun 20 15:33:50 2019 - [debug]  Connecting via SSH from [email protected](192.168.4.53:22) to [email protected](192.168.4.52:22)..
Thu Jun 20 15:33:50 2019 - [debug]   ok.
Thu Jun 20 15:33:51 2019 - [info] All SSH connection tests passed successfully.//测试成功提示

2)在管理主机,测试主从同步

 [root@host57 ~]# masterha_check_repl --conf=/etc/mha/app1.cnf //执行测试命令
Thu Jun 20 15:37:46 2019 - [info] Reading server configuration from /etc/mha/app1.cnf..
Thu Jun 20 15:37:46 2019 - [info] MHA::MasterMonitor version 0.56.
Thu Jun 20 15:37:47 2019 - [info] GTID failover mode = 0
Thu Jun 20 15:37:47 2019 - [info] Dead Servers: //没有停止的mysql服务器
Thu Jun 20 15:37:47 2019 - [info] Alive Servers://运行mysql服务主机列表
Thu Jun 20 15:37:47 2019 - [info]   192.168.4.51(192.168.4.51:3306)
Thu Jun 20 15:37:47 2019 - [info]   192.168.4.52(192.168.4.52:3306)
Thu Jun 20 15:37:47 2019 - [info]   192.168.4.53(192.168.4.53:3306)
Thu Jun 20 15:37:47 2019 - [info] Alive Slaves:
Thu Jun 20 15:37:47 2019 - [info]     Primary candidate for the new Master (candidate_master is set)
Thu Jun 20 15:37:47 2019 - [info]   192.168.4.53(192.168.4.53:3306)  Version=5.7.17-log (oldest major version between slaves) log-bin:enabled
Thu Jun 20 15:37:47 2019 - [info]     Replicating from 192.168.4.51(192.168.4.51:3306)
Thu Jun 20 15:37:47 2019 - [info]     Primary candidate for the new Master (candidate_master is set)
Thu Jun 20 15:37:47 2019 - [info] Current Alive Master: 192.168.4.51(192.168.4.51:3306)
Thu Jun 20 15:37:47 2019 - [info] Checking slave configurations..
Thu Jun 20 15:37:47 2019 - [info]  read_only=1 is not set on slave 192.168.4.52(192.168.4.52:3306).
Thu Jun 20 15:37:47 2019 - [info]  read_only=1 is not set on slave 192.168.4.53(192.168.4.53:3306).
Thu Jun 20 15:37:47 2019 - [info] Checking replication filtering settings..
Thu Jun 20 15:37:47 2019 - [info]  binlog_do_db= , binlog_ignore_db=
Thu Jun 20 15:37:47 2019 - [info]  Replication filtering check ok.
Thu Jun 20 15:37:47 2019 - [info] GTID (with auto-pos) is not supported
Thu Jun 20 15:37:47 2019 - [info] Starting SSH connection tests..
Thu Jun 20 15:37:49 2019 - [info] All SSH connection tests passed successfully.
Thu Jun 20 15:37:49 2019 - [info] Checking MHA Node version..
Thu Jun 20 15:37:50 2019 - [info]  Version check ok.
Thu Jun 20 15:37:50 2019 - [info] Checking SSH publickey authentication settings on the current master..
Thu Jun 20 15:37:50 2019 - [info] HealthCheck: SSH to 192.168.4.51 is reachable.
Thu Jun 20 15:37:50 2019 - [info] Master MHA Node version is 0.56.
Thu Jun 20 15:37:50 2019 - [info] Checking recovery script configurations on 192.168.4.51(192.168.4.51:3306)..
Thu Jun 20 15:37:50 2019 - [info]   Connecting to [email protected](192.168.4.51:22)..
  Creating /var/tmp if not exists..    ok.
  Checking output directory is accessible or not..
   ok.
  Binlog found at /var/lib/mysql, up to master51.000002
Thu Jun 20 15:37:50 2019 - [info] Binlog setting check done.
Thu Jun 20 15:37:50 2019 - [info] Checking SSH publickey authentication and checking recovery script configurations on all alive slave servers..
Thu Jun 20 15:37:50 2019 - [info]   Connecting to [email protected](192.168.4.52:22)..
  Checking slave recovery environment settings..
    Opening /var/lib/mysql/relay-log.info ... ok.
    Relay log found at /var/lib/mysql, up to host52-relay-bin.000006
    Temporary relay log file is /var/lib/mysql/host52-relay-bin.000006
    Testing mysql connection and privileges..mysql: [Warning] Using a password on the command line interface can be insecure.
 done.
    Testing mysqlbinlog output.. done.
    Cleaning up test file(s).. done.
Thu Jun 20 15:37:51 2019 - [info]   Executing command : apply_diff_relay_logs --command=test --slave_user='root' --slave_host=192.168.4.53 --slave_ip=192.168.4.53 --slave_port=3306 --workdir=/var/tmp --target_version=5.7.17-log --manager_version=0.56 --relay_log_info=/var/lib/mysql/relay-log.info  --relay_dir=/var/lib/mysql/  --slave_pass=xxx
Thu Jun 20 15:37:51 2019 - [info]   Connecting to [email protected](192.168.4.53:22)..
  Checking slave recovery environment settings..
    Opening /var/lib/mysql/relay-log.info ... ok.
    Relay log found at /var/lib/mysql, up to host53-relay-bin.000006
    Temporary relay log file is /var/lib/mysql/host53-relay-bin.000006
    Testing mysql connection and privileges..mysql: [Warning] Using a password on the command line interface can be insecure.
 done.
    Testing mysqlbinlog output.. done.
    Cleaning up test file(s).. done.
Thu Jun 20 15:37:52 2019 - [info] Slaves settings check done.
Thu Jun 20 15:37:52 2019 - [info]
192.168.4.51(192.168.4.51:3306) (current master)
 +--192.168.4.52(192.168.4.52:3306)
 +--192.168.4.53(192.168.4.53:3306)
Thu Jun 20 15:37:52 2019 - [info] Checking replication health on 192.168.4.52..
Thu Jun 20 15:37:52 2019 - [info]  ok.
Thu Jun 20 15:37:52 2019 - [info] Checking replication health on 192.168.4.53..
Thu Jun 20 15:37:52 2019 - [info]  ok.
Thu Jun 20 15:37:52 2019 - [info] Checking master_ip_failover_script status:
Thu Jun 20 15:37:52 2019 - [info]   /etc/mha/master_ip_failover --command=status --ssh_user=root --orig_master_host=192.168.4.51 --orig_master_ip=192.168.4.51 --orig_master_port=3306
Thu Jun 20 15:37:52 2019 - [info]  OK.
Thu Jun 20 15:37:52 2019 - [warning] shutdown_script is not defined.
Thu Jun 20 15:37:52 2019 - [info] Got exit code 0 (Not master dead).
MySQL Replication Health is OK.//测试成功提示信息

3)启动管理服务

[root@mgm57 ~]# masterha_manager --conf=/etc/mha/app1.cnf  --remove_dead_master_conf \
--ignore_last_failover //执行启动命令
Thu Jun 20 17:05:58 2019 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Thu Jun 20 17:05:58 2019 - [info] Reading application default configuration from /etc/mha/app1.cnf..
Thu Jun 20 17:05:58 2019 - [info] Reading server configuration from /etc/mha/app1.cnf.. 

4)查看服务状态

[root@mgm57 ~]#  masterha_check_status  --conf=/etc/mha/app1.cnf//执行命令
app1 (pid:15806) is running(0:PING_OK), master:192.168.4.51 //服务运行,监视主服务器192.168.4.51
[root@mgm57 ~]# ls /etc/mha/   //查看工作目录文件列表
app1.cnf  app1.master_status.health  manager.log  master_ip_failover

步骤二:访问集群

1)在主服务器51 添加访问数据的连接用户

]# mysql  -uroot -p123qqq...A
mysql> create database db9;
Query OK, 1 row affected (0.05 sec)
mysql> create table db9.a (id int);
Query OK, 0 rows affected (0.63 sec)
mysql> grant select,insert on db9.* to yaya55@"%" identified by "123qqq...A";
Query OK, 0 rows affected, 1 warning (0.08 sec)
mysql>exit

2)客户端50 连接vip地址访问集群

host50~]# mysql -h192.168.4.100  -uyaya55  -p123qqq...A
mysql> select  * from  db9.a;
mysql> insert into db9.a values(100);
mysql> select  * from db9.a;
+------+
| id   |
+------+
|  100 |
+------+
1 row in set (0.00 sec)
mysql>exit

3)在从服务器host52 查看数据

 [root@host52 ~]# mysql -uroot -p123qqq...A -e "select  * from db9.a"
mysql: [Warning] Using a password on the command line interface can be insecure.
+------+
| id   |
+------+
|  100 |
+------+

4)在从服务器host53 查看数据

[root@host53 ~]# mysql -uroot -p123qqq...A -e "select  * from db9.a"
mysql: [Warning] Using a password on the command line interface can be insecure.
+------+
| id   |
+------+
|  100 |
+------+

步骤三:测试高可用

1)停止主服务器51的mysql服务

host51~]# systemctl  stop  mysqld

2)查看管理服务 ,输出的监控信息

 [root@mgm57~]#masterha_manager --conf=/etc/mha/app1.cnf  --remove_dead_master_conf \
> --ignore_last_failover
Thu Jun 20 17:05:58 2019 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Thu Jun 20 17:05:58 2019 - [info] Reading application default configuration from /etc/mha/app1.cnf..
Thu Jun 20 17:05:58 2019 - [info] Reading server configuration from /etc/mha/app1.cnf..
  Creating /var/tmp if not exists..    ok.
  Checking output directory is accessible or not..
   ok.
  Binlog found at /var/lib/mysql, up to master51.000002
Thu Jun 20 17:35:59 2019 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Thu Jun 20 17:35:59 2019 - [info] Reading application default configuration from /etc/mha/app1.cnf..
Thu Jun 20 17:35:59 2019 - [info] Reading server configuration from /etc/mha/app1.cnf..
[root@host57 ~]#
[root@mgm57 ~]# masterha_check_status  --conf=/etc/mha/app1.cnf
app1 is stopped(2:NOT_RUNNING).  //监控到主服务器宕机 管理服务自动停止
[root@mgm57 ~]#

3)客户端依然连接vip地址,可以访问到数据

client50]# ping -c 2 192.168.4.100  //能够ping通vip地址
PING 192.168.4.100 (192.168.4.100) 56(84) bytes of data.
64 bytes from 192.168.4.100: icmp_seq=1 ttl=255 time=0.222 ms
64 bytes from 192.168.4.100: icmp_seq=2 ttl=255 time=0.121 ms
--- 192.168.4.71 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.121/0.171/0.222/0.052 ms
client50]# mysql -h192.168.4.100 -uyaya55 -p123qqq...A //连接vip地址
mysql> insert into db9.a values(200); //插入记录
mysql> select  * from db9.a;//查询记录
+------+
| id   |
+------+
|  100 |
|  200 |
+------+

4)查看vip地址

在host52主机查看到vip地址,说明host52 主机被选举为主服务器

 [root@host52 ~]# ifconfig  eth0:1
eth0:1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.4.100  netmask 255.255.255.0  broadcast 192.168.4.255
        ether 52:54:00:f5:c4:6a  txqueuelen 1000  (Ethernet)

在host53主机未查看到vip地址,说明host53主机是当前host52的从服务器

 [root@host53 ~]# ifconfig  eth0:1 //未查到vip地址
eth0:1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 52:54:00:28:22:2e  txqueuelen 1000  (Ethernet)
[root@host53 ~]# mysql -uroot -p123qqq...A -e "show slave status\G" | grep -i 192
mysql: [Warning] Using a password on the command line interface can be insecure.
                  Master_Host: 192.168.4.52  //主服务器Ip地址
[root@host53 ~]#
[root@host53 ~]# mysql -uroot -p123qqq...A -e "show slave status\G" | grep -i yes
mysql: [Warning] Using a password on the command line interface can be insecure.
             Slave_IO_Running: Yes  //IO线程正常
            Slave_SQL_Running: Yes  //SQL线程正常
 [root@host53 ~]# mysql -uroot -p123qqq...A -e "select  * from db9.a" //自动同步数据
mysql: [Warning] Using a password on the command line interface can be insecure.
+------+
| id   |
+------+
|  100 |
|  200 |
+------+

步骤四:修复故障服务器

1)配置数据库服务器

启动host51主机的数据库服务

host51~]# systemctl  start  mysqld

与主服务器数据一致

[root@host52 ~]#  mysqldump -uroot -p123qqq...A  --master-data  db9 > db9.sql //在主服务器host52 做完全备份
mysqldump: [Warning] Using a password on the command line interface can be insecure.
[root@host52 ~]#
[root@host52 ~]# scp db9.sql  [email protected]:/root/  //拷贝备份文件给host51主机
db9.sql  100% 1918     3.1MB/s   00:00
[root@host52 ~]#
host51 ~]# mysql -uroot -p123qqq...A db9 < /root/db9.sql//host51 主机使用备份文件恢复数据
mysql: [Warning] Using a password on the command line interface can be insecure.

指定主服务器信息

 [root@host51 ~]# grep master52 /root/db9.sql  //查看日志名及偏移量
CHANGE MASTER TO MASTER_LOG_FILE='master52.000001', MASTER_LOG_POS=895;
[root@host51 ~]# mysql -uroot -p123qqq...A
mysql>change master to master_host="192.168.4.52",master_user="repluser",master_password="123qqq...A",master_log_file="master52.000001",master_log_pos=895;
Query OK, 0 rows affected, 2 warnings (0.14 sec)

启动slave进程

mysql> start slave;
Query OK, 0 rows affected (0.01 sec)
Mysql> exit ;

查看状态信息

 [root@host51 ~]# mysql -uroot -p123qqq...A -e "show slave status\G" |grep 192.168.4.52
mysql: [Warning] Using a password on the command line interface can be insecure.
                  Master_Host: 192.168.4.52 //主服务器ip地址
[root@host51 ~]#
[root@host51 ~]# mysql -uroot -p123qqq...A -e "show slave status\G" |grep -i yes
mysql: [Warning] Using a password on the command line interface can be insecure.
             Slave_IO_Running: Yes //IO线程状态正常
            Slave_SQL_Running: Yes //SQL线程状态正常
[root@host51 ~]#

2)配置管理服务器

修改配置文件,添加数据库服务器host51

]# vim /etc/mha/app1.cnf
 [server1 ]
hostname=192.168.4.51
port=3306
candidate_master=1
:wq

测试集群环境

[root@mgm57 ~]# masterha_check_ssh --conf=/etc/mha/app1.cnf //测试SSH
Thu Jun 20 15:33:48 2019 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Thu Jun 20 15:33:48 2019 - [info] Reading application default configuration from /etc/mha/app1.cnf..
Thu Jun 20 15:33:48 2019 - [info] Reading server configuration from /etc/mha/app1.cnf..
Thu Jun 20 15:33:48 2019 - [info] Starting SSH connection tests..
Thu Jun 20 15:33:49 2019 - [debug]
Thu Jun 20 15:33:48 2019 - [debug]  Connecting via SSH from [email protected](192.168.4.51:22) to [email protected](192.168.4.52:22)..
Thu Jun 20 15:33:49 2019 - [debug]   ok.
Thu Jun 20 15:33:49 2019 - [debug]  Connecting via SSH from [email protected](192.168.4.51:22) to [email protected](192.168.4.53:22)..
Thu Jun 20 15:33:49 2019 - [debug]   ok.
Thu Jun 20 15:33:50 2019 - [debug]
Thu Jun 20 15:33:49 2019 - [debug]  Connecting via SSH from [email protected](192.168.4.52:22) to [email protected](192.168.4.51:22)..
Thu Jun 20 15:33:49 2019 - [debug]   ok.
Thu Jun 20 15:33:49 2019 - [debug]  Connecting via SSH from [email protected](192.168.4.52:22) to [email protected](192.168.4.53:22)..
Thu Jun 20 15:33:49 2019 - [debug]   ok.
Thu Jun 20 15:33:50 2019 - [debug]   ok.
Thu Jun 20 15:33:50 2019 - [debug]  Connecting via SSH from [email protected](192.168.4.53:22) to [email protected](192.168.4.52:22)..
Thu Jun 20 15:33:50 2019 - [debug]   ok.
Thu Jun 20 15:33:51 2019 - [info] All SSH connection tests passed successfully.//成功
 [root@mgm57 ~]# masterha_check_repl --conf=/etc/mha/app1.cnf//测试主从同步
Thu Jun 20 15:37:46 2019 - [info] Reading server configuration from /etc/mha/app1.cnf..
Thu Jun 20 15:37:46 2019 - [info] MHA::MasterMonitor version 0.56.
Thu Jun 20 15:37:47 2019 - [info] GTID failover mode = 0
Thu Jun 20 15:37:47 2019 - [info] Dead Servers:
Thu Jun 20 15:37:47 2019 - [info] Alive Servers:
Thu Jun 20 15:37:47 2019 - [info]   192.168.4.51(192.168.4.51:3306)
Thu Jun 20 15:37:47 2019 - [info]   192.168.4.52(192.168.4.52:3306)
Thu Jun 20 15:37:47 2019 - [info]   192.168.4.53(192.168.4.53:3306)
Thu Jun 20 15:37:47 2019 - [info] Alive Slaves:
Thu Jun 20 15:37:47 2019 - [info]     Primary candidate for the new Master (candidate_master is set)
Thu Jun 20 15:37:47 2019 - [info]   192.168.4.53(192.168.4.53:3306)  Version=5.7.17-log (oldest major version between slaves) log-bin:enabled
Thu Jun 20 15:37:47 2019 - [info]     Replicating from 192.168.4.51(192.168.4.51:3306)
Thu Jun 20 15:37:47 2019 - [info]     Primary candidate for the new Master (candidate_master is set)
Thu Jun 20 15:37:47 2019 - [info] Current Alive Master: 192.168.4.51(192.168.4.51:3306)
Thu Jun 20 15:37:47 2019 - [info] Checking slave configurations..
Thu Jun 20 15:37:47 2019 - [info]  read_only=1 is not set on slave 192.168.4.52(192.168.4.52:3306).
Thu Jun 20 15:37:47 2019 - [info]  read_only=1 is not set on slave 192.168.4.53(192.168.4.53:3306).
Thu Jun 20 15:37:47 2019 - [info] Checking replication filtering settings..
Thu Jun 20 15:37:47 2019 - [info]  binlog_do_db= , binlog_ignore_db=
Thu Jun 20 15:37:47 2019 - [info]  Replication filtering check ok.
Thu Jun 20 15:37:47 2019 - [info] GTID (with auto-pos) is not supported
Thu Jun 20 15:37:47 2019 - [info] Starting SSH connection tests..
Thu Jun 20 15:37:49 2019 - [info] All SSH connection tests passed successfully.
Thu Jun 20 15:37:49 2019 - [info] Checking MHA Node version..
Thu Jun 20 15:37:50 2019 - [info]  Version check ok.
Thu Jun 20 15:37:50 2019 - [info] Checking SSH publickey authentication settings on the current master..
Thu Jun 20 15:37:50 2019 - [info] HealthCheck: SSH to 192.168.4.51 is reachable.
Thu Jun 20 15:37:50 2019 - [info] Master MHA Node version is 0.56.
Thu Jun 20 15:37:50 2019 - [info] Checking recovery script configurations on 192.168.4.51(192.168.4.51:3306)..
Thu Jun 20 15:37:50 2019 - [info]   Connecting to [email protected](192.168.4.51:22)..
  Creating /var/tmp if not exists..    ok.
  Checking output directory is accessible or not..
   ok.
  Binlog found at /var/lib/mysql, up to master51.000002
Thu Jun 20 15:37:50 2019 - [info] Binlog setting check done.
Thu Jun 20 15:37:50 2019 - [info] Checking SSH publickey authentication and checking recovery script configurations on all alive slave servers..
Thu Jun 20 15:37:50 2019 - [info]   Connecting to [email protected](192.168.4.52:22)..
  Checking slave recovery environment settings..
    Opening /var/lib/mysql/relay-log.info ... ok.
    Relay log found at /var/lib/mysql, up to host52-relay-bin.000006
    Temporary relay log file is /var/lib/mysql/host52-relay-bin.000006
    Testing mysql connection and privileges..mysql: [Warning] Using a password on the command line interface can be insecure.
 done.
    Testing mysqlbinlog output.. done.
    Cleaning up test file(s).. done.
Thu Jun 20 15:37:51 2019 - [info]   Connecting to [email protected](192.168.4.53:22)..
  Checking slave recovery environment settings..
    Opening /var/lib/mysql/relay-log.info ... ok.
    Relay log found at /var/lib/mysql, up to host53-relay-bin.000006
    Temporary relay log file is /var/lib/mysql/host53-relay-bin.000006
    Testing mysql connection and privileges..mysql: [Warning] Using a password on the command line interface can be insecure.
 done.
    Testing mysqlbinlog output.. done.
    Cleaning up test file(s).. done.
Thu Jun 20 15:37:52 2019 - [info] Slaves settings check done.
Thu Jun 20 15:37:52 2019 - [info]
192.168.4.51(192.168.4.51:3306) (current master)
 +--192.168.4.52(192.168.4.52:3306)
 +--192.168.4.53(192.168.4.53:3306)
Thu Jun 20 15:37:52 2019 - [info] Checking replication health on 192.168.4.52..
Thu Jun 20 15:37:52 2019 - [info]  ok.
Thu Jun 20 15:37:52 2019 - [info] Checking replication health on 192.168.4.53..
Thu Jun 20 15:37:52 2019 - [info]  ok.
Thu Jun 20 15:37:52 2019 - [info] Checking master_ip_failover_script status:
Thu Jun 20 15:37:52 2019 - [info]   /etc/mha/master_ip_failover --command=status --ssh_user=root --orig_master_host=192.168.4.51 --orig_master_ip=192.168.4.51 --orig_master_port=3306
Thu Jun 20 15:37:52 2019 - [info]  OK.
Thu Jun 20 15:37:52 2019 - [warning] shutdown_script is not defined.
Thu Jun 20 15:37:52 2019 - [info] Got exit code 0 (Not master dead).
MySQL Replication Health is OK. //成功

重启管理服务

]# masterha_stop  --conf=/etc/mha/app1.cnf //停止管理服务
Stopped app1 successfully.
]# masterha_manager --conf=/etc/mha/app1.cnf  --remove_dead_master_conf \
--ignore_last_failover //启动管理服务
Thu Jun 20 17:05:58 2019 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Thu Jun 20 17:05:58 2019 - [info] Reading application default configuration from /etc/mha/app1.cnf..
Thu Jun 20 17:05:58 2019 - [info] Reading server configuration from /etc/mha/app1.cnf..

查看状态

mgm57 ~]# masterha_check_status  --conf=/etc/mha/app1.cnf
app1 (pid:15806) is running(0:PING_OK), master:192.168.4.52 //服务运行,监视服务器52
[root@mgm57 ~]#
发布了324 篇原创文章 · 获赞 12 · 访问量 8222

猜你喜欢

转载自blog.csdn.net/weixin_45843450/article/details/105499560