MHA 自动切换步骤及过程剖析(三)

2015-07-16 12:09:30 · 作者: · 浏览: 6
from_vdbsrv1_3306_20150420143022.binlog on vdbsrv2:3306.
? This may take long time...
Applying log files succeeded.
Mon Apr 20 14:30:36 2015 - [info]? All relay logs were successfully applied.
Mon Apr 20 14:30:36 2015 - [info] Getting new master's binlog name and position..
Mon Apr 20 14:30:36 2015 - [info]? mysql-bin.000011:241926689
Mon Apr 20 14:30:36 2015 - [info]? All other slaves should start replication from here. Statement should be: CHANGE MASTER TO
? MASTER_HOST='vdbsrv2 or 192.168.1.7', MASTER_PORT=3306, MASTER_LOG_FILE='mysql-bin.000011', MASTER_LOG_POS=241926689, MASTER_USER='repl',
? MASTER_PASSWORD='xxx';
Mon Apr 20 14:30:36 2015 - [info] Executing master IP activate script:? ###IP漂移
Mon Apr 20 14:30:36 2015 - [info]? /tmp/master_ip_failover --command=start --ssh_user=root --orig_master_host=vdbsrv1 --orig_master_ip=192.168.1.6
? --orig_master_port=3306 --new_master_host=vdbsrv2 --new_master_ip=192.168.1.7 --new_master_port=3306 --new_master_user='mha'
? --new_master_password='xxx'?
Unknown option: new_master_user
Unknown option: new_master_password


IN SCRIPT TEST====/sbin/ifconfig eth0:0 down==/sbin/ifconfig eth0:0 192.168.1.13/24===


----- Failover Report -----


app1: MySQL Master failover vdbsrv1(192.168.1.6:3306) to vdbsrv2(192.168.1.7:3306) succeeded


Master vdbsrv1(192.168.1.6:3306) is down!? ###整个failover总时间14:30:43-14:30:19=24s


Check MHA Manager logs at vdbsrv4:/var/log/masterha/app1/manager.log for details.


Started automated(non-interactive) failover.
Invalidated master IP address on vdbsrv1(192.168.1.6:3306)
The latest slave vdbsrv2(192.168.1.7:3306) has all relay logs for recovery.
Selected vdbsrv2(192.168.1.7:3306) as a new master.
vdbsrv2(192.168.1.7:3306): OK: Applying all logs succeeded.
vdbsrv2(192.168.1.7:3306): OK: Activated master IP address.
vdbsrv3(192.168.1.8:3306): Generating differential relay logs up to vdbsrv2(192.168.1.7:3306)succeeded.
Generating relay diff files from the latest slave succeeded.
vdbsrv3(192.168.1.8:3306): OK: Applying all logs succeeded. Slave started, replicating from vdbsrv2(192.168.1.7:3306)
vdbsrv2(192.168.1.7:3306): Resetting slave info succeeded.
Master failover to vdbsrv2(192.168.1.7:3306) completed successfully.