(1) 所有 Node 的 cnf 配置文件加上
- relay_log_purge=0
MHA 在发生切换的过程中,从库的恢复过程中依赖于 relay log 的相关信息,所以这里要将 relay log 的自动清除设置为 OFF,采用手动清除 relay log 的方式。
在默认情况下,从服务器上的中继日志会在 SQL 线程执行完毕后被自动删除。但是在 MHA 环境中,这些中继日志在恢复其他从服务器时可能会被用到,因此需要禁用中继日志的自动删除功能。定期清除中继日志需要考虑到复制延时的问题。在 ext3 的文件系统下,删除大的文件需要一定的时间,会导致严重的复制延时。为了避免复制延时,需要暂时为中继日志创建硬链接,因为在 linux 系统中通过硬链接删除大文件速度会很快。
提示:在 mysql 数据库中,删除大表时,通常也采用建立硬链接的方式
MHA 节点中包含了 pure_relay_logs 命令工具,它可以为中继日志创建硬链接,执行 SET GLOBAL relay_log_purge=1, 等待几秒钟以便 SQL 线程切换到新的中继日志,再执行 SET GLOBAL relay_log_purge=0。
pure_relay_logs 脚本参数如下所示:
- --user mysql 用户名
- --password mysql 密码
- --port 端口号
- --workdir 指定创建relay log的硬链接的位置,默认是/var/tmp,由于系统不同分区创建硬链接文件会失败,故需要执行硬链接具体位置,成功执行脚本后,硬链接的中继日志文件被删除
- --disable_relay_log_purge 默认情况下,如果relay_log_purge=1,脚本会什么都不清理,自动退出,通过设定这个参数,当relay_log_purge=1的情况下会将relay_log_purge设置为0。清理relay log之后,最后将参数设置为OFF。
(2) 在每台 slave Node 上创建
- vim /usr/local/mha/purge_relay_log.sh
- #!/bin/bash
- user=root
- passwd=root ####确保用户和密码能通过127.0.0.1登入
- host='127.0.0.1'port=3306work_dir='/mysql/data'purge='/usr/local/mha/bin/purge_relay_logs'
- $purge --user=$user --password=$passwd --host=$host --disable_relay_log_purge --port=$port --workdir=$work_dir >> /usr/local/mha/purge_relay_logs.log 2>&1
- chmod u+x /usr/local/mha/purge_relay_log.sh
将脚本加入到 os 定时任务中
- masterha_check_ssh --conf=/usr/local/mha/ha1/ha1.cnf
- [root@monitorha1]# masterha_check_ssh --conf=/usr/local/mha/ha1/ha1.cnfThu Aug25 14:53:30 2016- [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
- Thu Aug 25 14:53:30 2016- [info] Reading application default configurations from /usr/local/mha/ha1/ha1.cnf..
- Thu Aug 25 14:53:30 2016- [info] Reading server configurations from /usr/local/mha/ha1/ha1.cnf..
- Thu Aug 25 14:53:30 2016- [info] Starting SSH connection tests..
- Thu Aug 25 14:53:35 2016- [debug]
- Thu Aug 25 14:53:31 2016- [debug] Connecting via SSH from root@192.168.137.20(192.168.137.20:22) to root@192.168.137.10(192.168.137.10:22)..
- Thu Aug 25 14:53:33 2016- [debug] ok.
- Thu Aug 25 14:53:33 2016- [debug] Connecting via SSH from root@192.168.137.20(192.168.137.20:22) to root@192.168.137.30(192.168.137.30:22)..
- Thu Aug 25 14:53:34 2016- [debug] ok.
- Thu Aug 25 14:53:35 2016- [debug]
- Thu Aug 25 14:53:31 2016- [debug] Connecting via SSH from root@192.168.137.30(192.168.137.30:22) to root@192.168.137.10(192.168.137.10:22)..
- Thu Aug 25 14:53:33 2016- [debug] ok.
- Thu Aug 25 14:53:33 2016- [debug] Connecting via SSH from root@192.168.137.30(192.168.137.30:22) to root@192.168.137.20(192.168.137.20:22)..
- Thu Aug 25 14:53:34 2016- [debug] ok.
- Thu Aug 25 14:53:36 2016- [debug]
- Thu Aug 25 14:53:30 2016- [debug] Connecting via SSH from root@192.168.137.10(192.168.137.10:22) to root@192.168.137.20(192.168.137.20:22)..
- Thu Aug 25 14:53:34 2016- [debug] ok.
- Thu Aug 25 14:53:34 2016- [debug] Connecting via SSH from root@192.168.137.10(192.168.137.10:22) to root@192.168.137.30(192.168.137.30:22)..
- Thu Aug 25 14:53:35 2016- [debug] ok.
- Thu Aug 25 14:53:36 2016- [info] All SSH connection tests passed successfully.
可以看到每个 Node 到其它的 Node 都是相通的。
- masterha_check_repl --conf=/usr/local/mha/ha1/ha1.cnf
View Code
- [root@monitorha1]# masterha_check_repl --conf=/usr/local/mha/ha1/ha1.cnf Thu Aug25 16:09:19 2016- [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
- Thu Aug 25 16:09:19 2016- [info] Reading application default configurations from /usr/local/mha/ha1/ha1.cnf..
- Thu Aug 25 16:09:19 2016- [info] Reading server configurations from /usr/local/mha/ha1/ha1.cnf..
- Thu Aug 25 16:09:19 2016- [info] MHA::MasterMonitor version0.55.
- Thu Aug 25 16:09:20 2016- [info] Dead Servers:
- Thu Aug 25 16:09:20 2016- [info] Alive Servers:
- Thu Aug 25 16:09:20 2016- [info]192.168.137.10(192.168.137.10:3306)
- Thu Aug 25 16:09:20 2016- [info]192.168.137.20(192.168.137.20:3306)
- Thu Aug 25 16:09:20 2016- [info]192.168.137.30(192.168.137.30:3306)
- Thu Aug 25 16:09:20 2016- [info] Alive Slaves:
- Thu Aug 25 16:09:20 2016- [info]192.168.137.20(192.168.137.20:3306) Version=5.6.15-log(oldest major version between slaves)log-bin:enabled
- Thu Aug 25 16:09:20 2016- [info] Replicating from192.168.137.10(192.168.137.10:3306)
- Thu Aug 25 16:09:20 2016- [info] Primary candidatefor the new Master (candidate_master is set)
- Thu Aug 25 16:09:20 2016- [info]192.168.137.30(192.168.137.30:3306) Version=5.6.15-log(oldest major version between slaves)log-bin:enabled
- Thu Aug 25 16:09:20 2016- [info] Replicating from192.168.137.10(192.168.137.10:3306)
- Thu Aug 25 16:09:20 2016- [info] Not candidatefor the new Master (no_master is set)
- Thu Aug 25 16:09:20 2016- [info] Current Alive Master:192.168.137.10(192.168.137.10:3306)
- Thu Aug 25 16:09:20 2016- [info] Checking slave configurations..
- Thu Aug 25 16:09:20 2016- [info] read_only=1is not set on slave192.168.137.20(192.168.137.20:3306).
- Thu Aug 25 16:09:20 2016- [info] Checking replication filtering settings..
- Thu Aug 25 16:09:20 2016- [info] binlog_do_db= , binlog_ignore_db=
- Thu Aug 25 16:09:20 2016- [info] Replication filtering check ok.
- Thu Aug 25 16:09:20 2016- [info] Starting SSH connection tests..
- Thu Aug 25 16:09:25 2016- [info] All SSH connection tests passed successfully.
- Thu Aug 25 16:09:25 2016- [info] Checking MHA Node version..
- Thu Aug 25 16:09:26 2016- [info] Version check ok.
- Thu Aug 25 16:09:26 2016- [info] Checking SSH publickey authentication settings on the current master..
- Thu Aug 25 16:09:27 2016- [info] HealthCheck: SSH to192.168.137.10is reachable.
- Thu Aug 25 16:09:29 2016- [info] Master MHA Node version is0.54.
- Thu Aug 25 16:09:29 2016- [info] Checking recovery script configurations on the current master..
- Thu Aug 25 16:09:29 2016- [info] Executing command: save_binary_logs --command=test --start_pos=4--binlog_dir=/mysql/log--output_file=/tmp/save_binary_logs_test --manager_version=0.55--start_file=mysql-bin.000138
- Thu Aug 25 16:09:29 2016- [info] Connecting to root@192.168.137.10(192.168.137.10)..
- Creating /tmpifnotexists.. ok.
- Checking output directory is accessible or not..
- ok.
- Binlog found at /mysql/log, up to mysql-bin.000138
- Thu Aug 25 16:09:30 2016- [info] Master setting check done.
- Thu Aug 25 16:09:30 2016- [info] Checking SSH publickey authentication and checking recovery script configurations on all alive slave servers..
- Thu Aug 25 16:09:30 2016- [info] Executing command : apply_diff_relay_logs --command=test --slave_user='root'--slave_host=192.168.137.20--slave_ip=192.168.137.20--slave_port=3306--workdir=/tmp --target_version=5.6.15-log--manager_version=0.55--relay_log_info=/mysql/data/relay-log.info --relay_dir=/mysql/data/ --slave_pass=xxx
- Thu Aug 25 16:09:30 2016- [info] Connecting to root@192.168.137.20(192.168.137.20:22)..
- Checking slave recovery environment settings..
- Opening /mysql/data/relay-log.info ... ok.
- Relay logfound at /mysql/data, up to mysql-relay-bin.000006
- Temporary relay logfile is /mysql/data/mysql-relay-bin.000006
- Testing mysql connection and privileges..Warning: Using a password on the command line interface can be insecure.
- done.
- Testing mysqlbinlog output.. done.
- Cleaning up test file(s).. done.
- Thu Aug 25 16:09:31 2016- [info] Executing command : apply_diff_relay_logs --command=test --slave_user='root'--slave_host=192.168.137.30--slave_ip=192.168.137.30--slave_port=3306--workdir=/tmp --target_version=5.6.15-log--manager_version=0.55--relay_log_info=/mysql/data/relay-log.info --relay_dir=/mysql/data/ --slave_pass=xxx
- Thu Aug 25 16:09:31 2016- [info] Connecting to root@192.168.137.30(192.168.137.30:22)..
- Checking slave recovery environment settings..
- Opening /mysql/data/relay-log.info ... ok.
- Relay logfound at /mysql/data, up to mysql-relay-bin.000002
- Temporary relay logfile is /mysql/data/mysql-relay-bin.000002
- Testing mysql connection and privileges..Warning: Using a password on the command line interface can be insecure.
- done.
- Testing mysqlbinlog output.. done.
- Cleaning up test file(s).. done.
- Thu Aug 25 16:09:32 2016- [info] Slaves settings check done.
- Thu Aug 25 16:09:32 2016- [info]
- 192.168.137.10 (current master)
- +--192.168.137.20+--192.168.137.30
- Thu Aug 25 16:09:32 2016- [info] Checking replication health on192.168.137.20..
- Thu Aug 25 16:09:32 2016- [info] ok.
- Thu Aug 25 16:09:32 2016- [info] Checking replication health on192.168.137.30..
- Thu Aug 25 16:09:32 2016- [info] ok.
- Thu Aug 25 16:09:32 2016- [info] Checking master_ip_failover_script status:
- Thu Aug 25 16:09:32 2016- [info] /usr/local/mha/ha1/fail_script/master_ip_failover --command=status --ssh_user=root --orig_master_host=192.168.137.10--orig_master_ip=192.168.137.10--orig_master_port=3306
- IN SCRIPT TEST====/sbin/ifconfig eth0:1down==/sbin/ifconfig eth0:1 192.168.137.50/24===
- Checking the Status of the script.. OK
- Thu Aug 25 16:09:32 2016- [info] OK.
- Thu Aug 25 16:09:32 2016- [warning] shutdown_script is notdefined.
- Thu Aug 25 16:09:32 2016- [info] Gotexitcode0(Not master dead).
- MySQL Replication Health is OK.
--ignore_fail_on_start: 当有 slave 节点宕掉时,默认是启动不了的,加上 --ignore_fail_on_start 即使有节点宕掉也能启动 MHA,加上该参数会忽略启动文件中配置 ignore_fail=1 的 server
- masterha_check_status --conf=/usr/local/mha/ha1/ha1.cnf
由于 mha 还没有启动,所以这里检测是 stopped
- nohup masterha_manager --conf=/usr/local/mha/ha1/ha1.cnf --ignore_fail_on_start --ignore_last_failover < /dev/null > /usr/local/mha/ha1/start.log 2>&1&
--remove_dead_master_conf:该参数代表当发生主从切换后,老的主库的 ip 将会从配置文件中移除。这里暂时不使用该参数,因为发生使用该参数会将 ha1.cnf 配置文件搞乱。
--start_log: 日志。
--ignore_last_failover:发生主从切换后,MHAmanager 服务会自动停掉,且在 manager_workdir 目录下面生成文件 app1.failover.complete,若要启动 MHA,必须先删除该文件,该参数代表忽略上次 MHA 触发切换产生的文件,这里设置为 - ignore_last_failover。 在缺省情况下,如果 MHA 检测到连续发生宕机,且两次宕机间隔不足 8 小时的话,则不会进行 Failover,之所以这样限制是为了避免 ping-pong 效应。
--ignore_fail_on_start: 当有 slave 节点宕掉时,默认是启动不了的,加上 --ignore_fail_on_start 即使有节点宕掉也能启动 MHA,加上该参数会忽略启动文件中配置 ignore_fail=1 的 server。
(1) 再次查看 MHA 状态是否正常:
- [root@monitorha1]# masterha_check_status --conf=/usr/local/mha/ha1/ha1.cnfha1 (pid:6371) is running(0:PING_OK), master:192.168.137.10
- [root@monitorha1]#
(2) 查看启动日志
cat manager.log
- Thu Aug25 17:11:50 2016- [info]
- 192.168.137.10 (current master)
- +--192.168.137.20+--192.168.137.30
- Thu Aug 25 17:11:50 2016- [info] Checking master_ip_failover_script status:
- Thu Aug 25 17:11:50 2016- [info] /usr/local/mha/ha1/fail_script/master_ip_failover --command=status --ssh_user=root --orig_master_host=192.168.137.10--orig_master_ip=192.168.137.10--orig_master_port=3306
- IN SCRIPT TEST====/sbin/ifconfig eth0:1down==/sbin/ifconfig eth0:1 192.168.137.50/24===
- Checking the Status of the script.. OK
- Thu Aug 25 17:11:50 2016- [info] OK.
- Thu Aug 25 17:11:50 2016- [warning] shutdown_script is notdefined.
- Thu Aug 25 17:11:50 2016- [info] Set master ping interval1seconds.
- Thu Aug 25 17:11:50 2016- [info] Set secondary check script: /usr/local/mha/bin/masterha_secondary_check -s backup -s master --user=root --master_host=master --master_ip=192.168.137.10--master_port=3306
- Thu Aug 25 17:11:50 2016- [info] Starting ping health check on192.168.137.10(192.168.137.10:3306)..
- Thu Aug 25 17:11:50 2016- [info] Ping(SELECT) succeeded, waitinguntilMySQL doesn't respond..
- [root@monitor ha1]#
(3) 产生的文件
ha1.master_status.health:mha 正常启动会产生该文件
manager.log:mha 监控日志
start.log:mha 启动时生成的日志
- masterha_stop --conf=/usr/local/mha/ha1/ha1.cnf
发生主从切换后,MHA 服务会自动停掉
检查故障处理的日志,确保故障正常转移。
- cat /usr/local/mha/ha1/manager.log
处理故障的 master,将其配置为从库 chang 到新的 master,可以从 manager.log 找到 change 语句。
- grep"CHANGE MASTER TO MASTER"/usr/local/mha/ha1/manager.log | tail -1
- Fri Aug 26 12 : 04 : 22 2016 - [info] All other slaves should start replication from here.Statement should be: CHANGE MASTER TO MASTER_HOST = '192.168.137.10',
- MASTER_PORT = 3306,
- MASTER_LOG_FILE = 'mysql-bin.000143',
- MASTER_LOG_POS = 22123166,
- MASTER_USER = 'repl',
- MASTER_PASSWORD = 'xxx';
注意:这里要确保 slave 的 SQL_THREAD 和 IO_TRREAD 正常,如果是配置半同步复制要确保半同步复制启动正常,可以执行 "show status like'%rpl_%';", 具体参考前面半同步复制的搭建。
需要修改 "secondary_check_script" 选项中的 master_host、master_ip、master_port 为新的 master; 如果两台电脑的配置都相同的话其它地方不用修改。
由于启动 mha 的时候加上了 --ignore_last_failover 参数,所以不删除 failower 生成的文件也能启动,否则需要删除 failower 生成的文件 "ha1.failover.complete"。
- rm -f /usr/local/mha/ha1/ha1.failover.complete
- 检查SSH配置
- masterha_check_ssh --conf=/usr/local/mha/ha1/ha1.cnf
- 检查复制
- masterha_check_repl --conf=/usr/local/mha/ha1/ha1.cnf
- 检查状态
- masterha_check_status --conf=/usr/local/mha/ha1/ha1.cnf
必需保证所有的检查都通过
- nohup masterha_manager --conf=/usr/local/mha/ha1/ha1.cnf --ignore_fail_on_start --ignore_last_failover < /dev/null> /usr/local/mha/ha1/start.log2>&1&
我这里是异步复制,137.20 是当前的 master,然后在 137.20 上执行并发插入,同时关闭 137.10 和 137.30 的 IO 线程,在 137.20 上压测一段时间,然后先开启 137.30 的 IO 线程,过几秒钟再开启 137.10 的 IO 线程;保证 137.30 的 binlog 比候选的 137.10 的 binlog 更新。
master 137.20(22497564)
candidate slave:137.10(pos=9857376)
new replay slave:137.30(pos=22461852)
- Fri Aug 26 11:57:36 2016 - [warning] Got error on MySQL select ping: 2013 (Lost connection to MySQL server during query)
- Fri Aug 26 11:57:36 2016 - [info] Executing SSH check script: save_binary_logs --command=test --start_pos=4 --binlog_dir=/mysql/log --output_file=/tmp/save_binary_logs_test --manager_version=0.55 --binlog_prefix=mysql-bin
- Fri Aug 26 11:57:36 2016 - [info] Executing seconary network check script: /usr/local/mha/bin/masterha_secondary_check -s backup -s master --user=root --master_host=master --master_ip=192.168.137.10 --master_port=3306 --user=root --master_host=192.168.137.20 --master_ip=192.168.137.20 --master_port=3306
- Fri Aug 26 11:57:37 2016- [warning] Got error on MySQL connect:2003(Can't connect to MySQL server on '192.168.137.20' (111))Fri Aug26 11:57:37 2016- [warning] Connection failed1 time(s)..
- Fri Aug 26 11:57:38 2016- [warning] Got error on MySQL connect:2003(Can't connect to MySQL server on '192.168.137.20' (111))Fri Aug26 11:57:38 2016- [warning] Connection failed2 time(s)..
- Fri Aug 26 11:57:38 2016- [info] HealthCheck: SSH to192.168.137.20 is reachable.
- Monitoring server backup isreachable, Masterisnot reachablefrom backup. OK.
- Fri Aug 26 11:57:39 2016- [warning] Got error on MySQL connect:2003(Can't connect to MySQL server on '192.168.137.20' (111))Fri Aug26 11:57:39 2016- [warning] Connection failed3 time(s)..
- Monitoring server master isreachable, Masterisnot reachablefrom master. OK.
- Fri Aug 26 11:57:41 2016- [info] Masterisnot reachablefrom all other monitoring servers. Failover should start.
- Fri Aug 26 11:57:41 2016- [warning] Masterisnot reachablefromhealth checker!
- Fri Aug 26 11:57:41 2016- [warning] Master192.168.137.20(192.168.137.20:3306)isnot reachable!
- Fri Aug 26 11:57:41 2016- [warning] SSHis reachable.
- Fri Aug 26 11:57:41 2016- [info] Connecting to a master server failed. Reading configuration file /etc/masterha_default.cnf and /usr/local/mha/ha1/ha1.cnf again, and trying to connect to all servers to check server status..
- Fri Aug 26 11:57:41 2016- [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
- Fri Aug 26 11:57:41 2016- [info] Reading applicationdefaultconfigurationsfrom/usr/local/mha/ha1/ha1.cnf..
- Fri Aug 26 11:57:41 2016- [info] Reading server configurationsfrom/usr/local/mha/ha1/ha1.cnf..
- Fri Aug 26 11:57:42 2016- [info] Dead Servers:
- Fri Aug 26 11:57:42 2016- [info]192.168.137.20(192.168.137.20:3306)
- Fri Aug 26 11:57:42 2016- [info] Alive Servers:
- Fri Aug 26 11:57:42 2016- [info]192.168.137.10(192.168.137.10:3306)
- Fri Aug 26 11:57:42 2016- [info]192.168.137.30(192.168.137.30:3306)
- Fri Aug 26 11:57:42 2016- [info] Alive Slaves:
- Fri Aug 26 11:57:42 2016- [info]192.168.137.10(192.168.137.10:3306) Version=5.6.15-log (oldest major version between slaves) log-bin:enabled
- Fri Aug 26 11:57:42 2016- [info] Replicatingfrom 192.168.137.20(192.168.137.20:3306)
- Fri Aug 26 11:57:42 2016- [info] Primary candidateforthenewMaster (candidate_masteris set)
- Fri Aug 26 11:57:42 2016- [info]192.168.137.30(192.168.137.30:3306) Version=5.6.15-log (oldest major version between slaves) log-bin:enabled
- Fri Aug 26 11:57:42 2016- [info] Replicatingfrom 192.168.137.20(192.168.137.20:3306)
- Fri Aug 26 11:57:42 2016- [info] Not candidateforthenewMaster (no_masteris set)
- Fri Aug 26 11:57:42 2016- [info] Checking slave configurations..
- Fri Aug 26 11:57:42 2016- [info] read_only=1 isnotseton slave192.168.137.10(192.168.137.10:3306).
- Fri Aug 26 11:57:42 2016- [info] Checking replication filtering settings..
- Fri Aug 26 11:57:42 2016- [info] Replication filtering check ok.
- Fri Aug 26 11:57:42 2016- [info] Masterisdown!
- Fri Aug 26 11:57:42 2016- [info] Terminating monitoring script.
- Fri Aug 26 11:57:42 2016- [info] Got exit code20 (Master dead).
- Fri Aug 26 11:57:42 2016- [info] MHA::MasterFailover version0.55.
- Fri Aug 26 11:57:42 2016- [info] Starting master failover.
- Fri Aug 26 11:57:42 2016-[info]Fri Aug 26 11:57:42 2016 - [info] * Phase 1: Configuration Check Phase..Fri Aug26 11:57:42 2016- [info]
- Fri Aug 26 11:57:44 2016- [info] Dead Servers:
- Fri Aug 26 11:57:44 2016- [info]192.168.137.20(192.168.137.20:3306)
- Fri Aug 26 11:57:44 2016- [info] Checking master reachability via mysql(double check)..
- Fri Aug 26 11:57:44 2016- [info] ok.
- Fri Aug 26 11:57:44 2016- [info] Alive Servers:
- Fri Aug 26 11:57:44 2016- [info]192.168.137.10(192.168.137.10:3306)
- Fri Aug 26 11:57:44 2016- [info]192.168.137.30(192.168.137.30:3306)
- Fri Aug 26 11:57:44 2016- [info] Alive Slaves:
- Fri Aug 26 11:57:44 2016- [info]192.168.137.10(192.168.137.10:3306) Version=5.6.15-log (oldest major version between slaves) log-bin:enabled
- Fri Aug 26 11:57:44 2016- [info] Replicatingfrom 192.168.137.20(192.168.137.20:3306)
- Fri Aug 26 11:57:44 2016- [info] Primary candidateforthenewMaster (candidate_masteris set)
- Fri Aug 26 11:57:44 2016- [info]192.168.137.30(192.168.137.30:3306) Version=5.6.15-log (oldest major version between slaves) log-bin:enabled
- Fri Aug 26 11:57:44 2016- [info] Replicatingfrom 192.168.137.20(192.168.137.20:3306)
- Fri Aug 26 11:57:44 2016- [info] Not candidateforthenewMaster (no_masteris set)
- Fri Aug 26 11:57:44 2016- [info] ** Phase1: Configuration Check Phase completed.
- Fri Aug 26 11:57:44 2016-[info]Fri Aug 26 11:57:44 2016 - [info] * Phase 2: Dead Master Shutdown Phase..Fri Aug26 11:57:44 2016- [info]
- Fri Aug 26 11:57:44 2016- [info] Forcing shutdown so that applications never connect to the current master..
- Fri Aug 26 11:57:44 2016-[info] Executing master IP deactivatation script:Fri Aug 26 11:57:44 2016 - [info] /usr/local/mha/ha1/fail_script/master_ip_failover --orig_master_host=192.168.137.20 --orig_master_ip=192.168.137.20 --orig_master_port=3306 --command=stopssh --ssh_user=root
- IN SCRIPT TEST====/sbin/ifconfig eth0:1 down==/sbin/ifconfig eth0:1 192.168.137.50/24===
- Disabling the VIP on old master: 192.168.137.20
- Fri Aug 26 11:57:45 2016- [info] done.
- Fri Aug 26 11:57:45 2016- [warning] shutdown_scriptisnotset. Skippingexplicit shutting down of the dead master.
- Fri Aug 26 11:57:45 2016- [info]* Phase 2: Dead Master Shutdown Phase completed.
- Fri Aug 26 11:57:45 2016-[info]Fri Aug 26 11:57:45 2016 - [info] * Phase 3: Master Recovery Phase..Fri Aug26 11:57:45 2016-[info]Fri Aug 26 11:57:45 2016 - [info] * Phase 3.1: Getting Latest Slaves Phase..Fri Aug26 11:57:45 2016- [info]
- Fri Aug 26 11:57:45 2016- [info] The latest binary log file/position on all slavesismysql-bin.000074:22461852
- Fri Aug 26 11:
来源: http://www.cnblogs.com/chenmh/p/5796115.html