在mysql的复制,当主服务崩溃了,利用mha实现主服务自动切换,并能使其他从服务切换到新的主机。下面是部署步骤
(1)准备三机器:主服务 192.168.8.120,备主 192.168.8.121 ,从服务和管理节点192.168.8.122
(2)修改各台主机名 如 管理节点192.168.8.122
[root@centos3 mha]# more /etc/hosts
127.0.0.1
192.168.8.120 centos1
192.168.8.121 centos2
192.168.8.122 centos3
(3)数据节点
安装mha4mysql-node-0.53.tar.gz
对三台mariadb数据节点只需安装mha4mysql-node-0.53.tar.gz
[root@centos1mha]#rpm -ivh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
[root@centos1mha]#yum -y install perl-DBD-MySQL
[root@centos1mha]#tar -zxfmha4mysql-node-0.53.tar.gz
[root@centos1mha]# cdmha4mysql-node-0.53
[root@centos1mha]#
[root@centos1mha]#make
(4)管理节点
[root@sh-gs-dbmg0227 ~]#
//这个是centos5.x 如果是6.x rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
[root@centos3 mha]# yum -y installperl-DBD-MySQL
[root@centos3 mha]# tar -zxfmha4mysql-node-0.53.tar.gz
[root@centos3 mha]# cd mha4mysql-node-0.53
[root@centos3 mha]#perl
[root@centos3 mha]#make
[root@centos3 mha]#
[root@centos3 mha]# tar -zxfmha4mysql-manager-0.53.tar.gz
[root@centos3 mha]#perl
如果在该过程中出现下面错误
Can't locate ExtUtils/MakeMaker.pm in @INC (@INC contains: inc/usr/local/lib64/perl5 /usr/local/share/perl5/usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl/usr/lib64/perl5 /usr/share/perl5 .) at inc/Module/Install/Can.pmline 6.
解决方法:
[root@centos3 mha]#make
[root@centos3mha]# mkdir/etc/masterha
[root@centos3mha]# mkdir -p/master/app1
[root@centos3mha]# mkdir -p/scripts
[root@centos3mha]# cp samples/conf/*/etc/masterha/
[root@centos3mha]# cpsamples/scripts/*
配置管理节点
[root@centos3mha]#more
[server default]
user=root
password=123456
ssh_user=root
repl_user=repl
repl_password=qwert
master_binlog_dir= /app/mysql
remote_workdir=/app/mha
secondary_check_script= masterha_secondary_check-s192.168.12.234-s192.168.12.232
ping_interval=1
master_ip_failover_script=/scripts/master_ip_failover
#shutdown_script=/scripts/power_manager
report_script= /scripts/send_report
master_ip_online_change_script=/scripts/master_ip_online_change
[root@centos3mha]# more
[server default]
manager_workdir=/app/mha
manager_log=/app/mha/manager.log
[server1]
hostname=192.168.8.120
candidate_master=1
[server2]
hostname=192.168.8.121
candidate_master=1
[server3]
hostname=192.168.8.122
no_master=1
(5)在mysql 添加用户,复制设置
mysql 主节点
grant replication slave
grant
备主节点
grant replication slave on *.* to 'repl'@'192.168.8.%'
grant
set read_only=1
set relay_log_purge=0
从节点
set read_only=1
set relay_log_purge=0
(6)配置ssh
[[root@centos3~#ssh-keygen -t rsa
[root@centos3~]# ssh-copy-id -i.ssh/id_rsa.pub root@192.168.8.120
[root@centos3~]#ssh-copy-id -i .ssh/id_rsa.pub root@192.168.8.121
[root@centos1~]# ssh-keygen -t rsa
[root@centos1~]# ssh-copy-id -i.ssh/id_rsa.pub root@192.168.8.121
[root@centos1~]# ssh-copy-id -i.ssh/id_rsa.pub root@192.168.8.122
[root@centos2~]# ssh-keygen -trsa
[root@centos2~]# ssh-copy-id -i.ssh/id_rsa.pub root@192.168.8.120
[root@centos2~]#
(7)测试ssh
Sat Aug 10 06:15:39 2013 - [info] Reading default configuratoinsfrom /etc/masterha/masterha_default.cnf..
Sat Aug 10 06:15:39 2013 - [info] Reading application defaultconfigurations from /etc/masterha/app1.cnf..
Sat Aug 10 06:15:39 2013 - [info] Reading server configurationsfrom /etc/masterha/app1.cnf..
Sat Aug 10 06:15:39 2013 - [info] Starting SSH connectiontests..
Sat Aug 10 06:15:42 2013 - [debug]
Sat Aug 10 06:15:39 2013 - [debug]
Sat Aug 10 06:15:41 2013 -[debug]
Sat Aug 10 06:15:41 2013 - [debug]
Sat Aug 10 06:15:42 2013 -[debug]
Sat Aug 10 06:15:43 2013 - [debug]
Sat Aug 10 06:15:40 2013 - [debug]
Sat Aug 10 06:15:41 2013 -[debug]
Sat Aug 10 06:15:41 2013 - [debug]
Sat Aug 10 06:15:43 2013 -[debug]
Sat Aug 10 06:15:44 2013 - [debug]
Sat Aug 10 06:15:40 2013 - [debug]
Sat Aug 10 06:15:42 2013 -[debug]
Sat Aug 10 06:15:42 2013 - [debug]
Sat Aug 10 06:15:44 2013 -[debug]
Sat Aug 10 06:15:44 2013 - [info] All SSH connection tests passedsuccessfully.
(8)测试复制
[root@centos3 mha]#
Sat Aug 10 06:26:13 2013 - [info] Reading default configuratoinsfrom /etc/masterha/masterha_default.cnf..
Sat Aug 10 06:26:13 2013 - [info] Reading application defaultconfigurations from /etc/masterha/app1.cnf..
Sat Aug 10 06:26:13 2013 - [info] Reading server configurationsfrom /etc/masterha/app1.cnf..
Sat Aug 10 06:26:13 2013 - [info] MHA::MasterMonitor version0.53.
Sat Aug 10 06:26:13 2013 - [info] Dead Servers:
Sat Aug 10 06:26:13 2013 - [info] Alive Servers:
Sat Aug 10 06:26:13 2013 -[info]
Sat Aug 10 06:26:13 2013 -[info]
Sat Aug 10 06:26:13 2013 -[info]
Sat Aug 10 06:26:13 2013 - [info] Alive Slaves:
Sat Aug 10 06:26:13 2013 -[info]
Sat Aug 10 06:26:13 2013 -[info]
Sat Aug 10 06:26:13 2013 -[info]
Sat Aug 10 06:26:13 2013 -[info]
Sat Aug 10 06:26:13 2013 -[info]
Sat Aug 10 06:26:13 2013 -[info]
Sat Aug 10 06:26:13 2013 - [info] Current Alive Master:192.168.8.120(192.168.8.120:3306)
Sat Aug 10 06:26:13 2013 - [info] Checking slaveconfigurations..
Sat Aug 10 06:26:13 2013 - [info] Checking replication filteringsettings..
Sat Aug 10 06:26:13 2013 - [info]
Sat Aug 10 06:26:13 2013 - [info]
Sat Aug 10 06:26:13 2013 - [info] Starting SSH connectiontests..
Sat Aug 10 06:26:17 2013 - [info] All SSH connection tests passedsuccessfully.
Sat Aug 10 06:26:17 2013 - [info] Checking MHA Node version..
Sat Aug 10 06:26:18 2013 - [info]
Sat Aug 10 06:26:18 2013 - [info] Checking SSH publickeyauthentication settings on the current master..
Sat Aug 10 06:26:18 2013 - [info] HealthCheck: SSH to 192.168.8.120is reachable.
Sat Aug 10 06:26:18 2013 - [info] Master MHA Node version is0.53.
Sat Aug 10 06:26:18 2013 - [info] Checking recovery scriptconfigurations on the current master..
Sat Aug 10 06:26:18 2013 -[info]
Sat Aug 10 06:26:18 2013 -[info]
Sat Aug 10 06:26:18 2013 - [info] Master setting check done.
Sat Aug 10 06:26:18 2013 - [info] Checking SSH publickeyauthentication and checking recovery script configurations on allalive slave servers..
Sat Aug 10 06:26:18 2013 -[info]
Sat Aug 10 06:26:18 2013 -[info]
Sat Aug 10 06:26:19 2013 -[info]
Sat Aug 10 06:26:19 2013 -[info]
Sat Aug 10 06:26:20 2013 - [info] Slaves settings check done.
Sat Aug 10 06:26:20 2013 - [info]
192.168.8.120 (current master)
Sat Aug 10 06:26:20 2013 - [info] Checking replication health on192.168.8.121..
Sat Aug 10 06:26:20 2013 - [info]
Sat Aug 10 06:26:20 2013 - [info] Checking replication health on192.168.8.122..
Sat Aug 10 06:26:20 2013 - [info]
Sat Aug 10 06:26:20 2013 - [info] Checkingmaster_ip_failover_script status:
Sat Aug 10 06:26:20 2013 -[info]
Sat Aug 10 06:26:20 2013 - [info]
Sat Aug 10 06:26:20 2013 - [warning] shutdown_script is notdefined.
Sat Aug 10 06:26:20 2013 - [info] Got exit code 0 (Not masterdead).
MySQL Replication Health is OK.
(9)启动management
[root@centos3 mysql]# nohup masterha_manager
Sat Aug 10 06:29:36 2013 - [info] MHA::MasterMonitor version0.53.
Sat Aug 10 06:29:37 2013 - [info] Dead Servers:
Sat Aug 10 06:29:37 2013 - [info] Alive Servers:
Sat Aug 10 06:29:37 2013 -[info]
Sat Aug 10 06:29:37 2013 -[info]
Sat Aug 10 06:29:37 2013 -[info]
Sat Aug 10 06:29:37 2013 - [info] Alive Slaves:
Sat Aug 10 06:29:37 2013 -[info]
Sat Aug 10 06:29:37 2013 -[info]
Sat Aug 10 06:29:37 2013 -[info]
Sat Aug 10 06:29:37 2013 -[info]
Sat Aug 10 06:29:37 2013 -[info]
Sat Aug 10 06:29:37 2013 -[info]
Sat Aug 10 06:29:37 2013 - [info] Current Alive Master:192.168.8.120(192.168.8.120:3306)
Sat Aug 10 06:29:37 2013 - [info] Checking slaveconfigurations..
Sat Aug 10 06:29:37 2013 - [info] Checking replication filteringsettings..
Sat Aug 10 06:29:37 2013 - [info]
Sat Aug 10 06:29:37 2013 - [info]
Sat Aug 10 06:29:37 2013 - [info] Starting SSH connectiontests..
Sat Aug 10 06:29:40 2013 - [info] All SSH connection tests passedsuccessfully.
Sat Aug 10 06:29:40 2013 - [info] Checking MHA Node version..
Sat Aug 10 06:29:41 2013 - [info]
Sat Aug 10 06:29:41 2013 - [info] Checking SSH publickeyauthentication settings on the current master..
Sat Aug 10 06:29:42 2013 - [info] HealthCheck: SSH to 192.168.8.120is reachable.
Sat Aug 10 06:29:42 2013 - [info] Master MHA Node version is0.53.
Sat Aug 10 06:29:42 2013 - [info] Checking recovery scriptconfigurations on the current master..
Sat Aug 10 06:29:42 2013 -[info]
Sat Aug 10 06:29:42 2013 -[info]
Sat Aug 10 06:29:42 2013 - [info] Master setting check done.
Sat Aug 10 06:29:42 2013 - [info] Checking SSH publickeyauthentication and checking recovery script configurations on allalive slave servers..
Sat Aug 10 06:29:42 2013 -[info]
Sat Aug 10 06:29:42 2013 -[info]
Sat Aug 10 06:29:43 2013 -[info]
Sat Aug 10 06:29:43 2013 -[info]
Sat Aug 10 06:29:43 2013 - [info] Slaves settings check done.
Sat Aug 10 06:29:43 2013 - [info]
192.168.8.120 (current master)
Sat Aug 10 06:29:43 2013 - [info] Checkingmaster_ip_failover_script status:
Sat Aug 10 06:29:43 2013 -[info]
Sat Aug 10 06:29:44 2013 - [info]
Sat Aug 10 06:29:44 2013 - [warning] shutdown_script is notdefined.
Sat Aug 10 06:29:44 2013 - [info] Set master ping interval 1seconds.
Sat Aug 10 06:29:44 2013 - [info] Set secondary check script:masterha_secondary_check -s 192.168.8.121 -s 192.168.8.122
Sat Aug 10 06:29:44 2013 - [info] Starting ping health check on192.168.8.120(192.168.8.120:3306)..
Sat Aug 10 06:29:44 2013 - [info] Ping(SELECT) succeeded, waitinguntil MySQL doesn't respond..
[root@sh-gs-dbmg0227 /]# masterha_check_status--conf=/etc/masterha/app1.cnf
app1 (pid:7127) is running(0:PING_OK),master:192.168.8.121
(10)在备节点,从节点 执行定期删除中继日志
00 00 * * * /usr/local/bin/purge_relay_logs –user=root–password=123456 –disable_relay_log_purge >>/masterha/purge_relay_logs.log 2>&1
(11)测试 关闭mysql主服务服务,主机宕机。主服务是否自动切换。
Sat Aug 10 06:29:36 2013 - [info] MHA::MasterMonitor version0.53.
Sat Aug 10 06:29:37 2013 - [info] Dead Servers:
Sat Aug 10 06:29:37 2013 - [info] Alive Servers:
Sat Aug 10 06:29:37 2013 -[info]
Sat Aug 10 06:29:37 2013 -[info]
Sat Aug 10 06:29:37 2013 -[info]
Sat Aug 10 06:29:37 2013 - [info] Alive Slaves:
Sat Aug 10 06:29:37 2013 -[info]
Sat Aug 10 06:29:37 2013 -[info]
Sat Aug 10 06:29:37 2013 -[info]
Sat Aug 10 06:29:37 2013 -[info]
Sat Aug 10 06:29:37 2013 -[info]
Sat Aug 10 06:29:37 2013 -[info]
Sat Aug 10 06:29:37 2013 - [info] Current Alive Master:192.168.8.120(192.168.8.120:3306)
Sat Aug 10 06:29:37 2013 - [info] Checking slaveconfigurations..
Sat Aug 10 06:29:37 2013 - [info] Checking replication filteringsettings..
Sat Aug 10 06:29:37 2013 - [info]
Sat Aug 10 06:29:37 2013 - [info]
Sat Aug 10 06:29:37 2013 - [info] Starting SSH connectiontests..
Sat Aug 10 06:29:40 2013 - [info] All SSH connection tests passedsuccessfully.
Sat Aug 10 06:29:40 2013 - [info] Checking MHA Node version..
Sat Aug 10 06:29:41 2013 - [info]
Sat Aug 10 06:29:41 2013 - [info] Checking SSH publickeyauthentication settings on the current master..
Sat Aug 10 06:29:42 2013 - [info] HealthCheck: SSH to 192.168.8.120is reachable.
Sat Aug 10 06:29:42 2013 - [info] Master MHA Node version is0.53.
Sat Aug 10 06:29:42 2013 - [info] Checking recovery scriptconfigurations on the current master..
Sat Aug 10 06:29:42 2013 -[info]
Sat Aug 10 06:29:42 2013 -[info]
Sat Aug 10 06:29:42 2013 - [info] Master setting check done.
Sat Aug 10 06:29:42 2013 - [info] Checking SSH publickeyauthentication and checking recovery script configurations on allalive slave servers..
Sat Aug 10 06:29:42 2013 -[info]
Sat Aug 10 06:29:42 2013 -[info]
Sat Aug 10 06:29:43 2013 -[info]
Sat Aug 10 06:29:43 2013 -[info]
Sat Aug 10 06:29:43 2013 - [info] Slaves settings check done.
Sat Aug 10 06:29:43 2013 - [info]
192.168.8.120 (current master)
Sat Aug 10 06:29:43 2013 - [info] Checkingmaster_ip_failover_script status:
Sat Aug 10 06:29:43 2013 -[info]
Sat Aug 10 06:29:44 2013 - [info]
Sat Aug 10 06:29:44 2013 - [warning] shutdown_script is notdefined.
Sat Aug 10 06:29:44 2013 - [info] Set master ping interval 1seconds.
Sat Aug 10 06:29:44 2013 - [info] Set secondary check script:masterha_secondary_check -s 192.168.8.121 -s 192.168.8.122
Sat Aug 10 06:29:44 2013 - [info] Starting ping health check on192.168.8.120(192.168.8.120:3306)..
Sat Aug 10 06:29:44 2013 - [info] Ping(SELECT) succeeded, waitinguntil MySQL doesn't respond..
Sat Aug 10 06:31:27 2013 - [warning] Got error on MySQL selectping: 2006 (MySQL server has gone away)
Sat Aug 10 06:31:27 2013 - [info] Executing seconary network checkscript: masterha_secondary_check -s 192.168.8.121 -s192.168.8.122
Sat Aug 10 06:31:27 2013 - [info] Executing SSH check script:save_binary_logs --command=test --start_pos=4--binlog_dir=/app/mysql--output_file=/app/mha/save_binary_logs_test --manager_version=0.53--binlog_prefix=mysql-bin
Sat Aug 10 06:31:28 2013 - [info] HealthCheck: SSH to 192.168.8.120is reachable.
Sat Aug 10 06:31:28 2013 - [warning] Got error on MySQL connect:2013 (Lost connection to MySQL server at 'reading initialcommunication packet', system error: 111)
Sat Aug 10 06:31:28 2013 - [warning] Connection failed 1time(s)..
Monitoring server 192.168.8.121 is reachable, Master is notreachable from 192.168.8.121. OK.
Monitoring server 192.168.8.122 is reachable, Master is notreachable from 192.168.8.122. OK.
Sat Aug 10 06:31:29 2013 - [info] Master is not reachable from allother monitoring servers. Failover should start.
Sat Aug 10 06:31:29 2013 - [warning] Got error on MySQL connect:2013 (Lost connection to MySQL server at 'reading initialcommunication packet', system error: 111)
Sat Aug 10 06:31:29 2013 - [warning] Connection failed 2time(s)..
Sat Aug 10 06:31:30 2013 - [warning] Got error on MySQL connect:2013 (Lost connection to MySQL server at 'reading initialcommunication packet', system error: 111)
Sat Aug 10 06:31:30 2013 - [warning] Connection failed 3time(s)..
Sat Aug 10 06:31:30 2013 - [warning] Master is not reachable fromhealth checker!
Sat Aug 10 06:31:30 2013 - [warning] Master192.168.8.120(192.168.8.120:3306) is not reachable!
Sat Aug 10 06:31:30 2013 - [warning] SSH is reachable.
Sat Aug 10 06:31:30 2013 - [info] Connecting to a master serverfailed. Reading configuration file/etc/masterha/masterha_default.cnf and /etc/masterha/app1.cnfagain, and trying to connect to all servers to check serverstatus..
Sat Aug 10 06:31:30 2013 - [info] Reading default configuratoinsfrom /etc/masterha/masterha_default.cnf..
Sat Aug 10 06:31:30 2013 - [info] Reading application defaultconfigurations from /etc/masterha/app1.cnf..
Sat Aug 10 06:31:30 2013 - [info] Reading server configurationsfrom /etc/masterha/app1.cnf..
Sat Aug 10 06:31:30 2013 - [info] Dead Servers:
Sat Aug 10 06:31:30 2013 -[info]
Sat Aug 10 06:31:30 2013 - [info] Alive Servers:
Sat Aug 10 06:31:30 2013 -[info]
Sat Aug 10 06:31:30 2013 -[info]
Sat Aug 10 06:31:30 2013 - [info] Alive Slaves:
Sat Aug 10 06:31:30 2013 -[info]
Sat Aug 10 06:31:30 2013 -[info]
Sat Aug 10 06:31:30 2013 -[info]
Sat Aug 10 06:31:30 2013 -[info]
Sat Aug 10 06:31:30 2013 -[info]
Sat Aug 10 06:31:30 2013 -[info]
Sat Aug 10 06:31:30 2013 - [info] Checking slaveconfigurations..
Sat Aug 10 06:31:30 2013 - [info] Checking replication filteringsettings..
Sat Aug 10 06:31:30 2013 - [info]
Sat Aug 10 06:31:30 2013 - [info] Master is down!
Sat Aug 10 06:31:30 2013 - [info] Terminating monitoringscript.
Sat Aug 10 06:31:30 2013 - [info] Got exit code 20 (Masterdead).
Sat Aug 10 06:31:30 2013 - [info] MHA::MasterFailover version0.53.
Sat Aug 10 06:31:30 2013 - [info] Starting master failover.
Sat Aug 10 06:31:30 2013 - [info]
Sat Aug 10 06:31:30 2013 - [info] * Phase 1: Configuration CheckPhase..
Sat Aug 10 06:31:30 2013 - [info]
Sat Aug 10 06:31:30 2013 - [info] Dead Servers:
Sat Aug 10 06:31:30 2013 -[info]
Sat Aug 10 06:31:30 2013 - [info] Checking master reachability viamysql(double check)..
Sat Aug 10 06:31:30 2013 - [info]
Sat Aug 10 06:31:30 2013 - [info] Alive Servers:
Sat Aug 10 06:31:30 2013 -[info]
Sat Aug 10 06:31:30 2013 -[info]
Sat Aug 10 06:31:30 2013 - [info] Alive Slaves:
Sat Aug 10 06:31:30 2013 -[info]
Sat Aug 10 06:31:30 2013 -[info]
Sat Aug 10 06:31:30 2013 -[info]
Sat Aug 10 06:31:30 2013 -[info]
Sat Aug 10 06:31:30 2013 -[info]
Sat Aug 10 06:31:30 2013 -[info]
Sat Aug 10 06:31:30 2013 - [info] ** Phase 1: Configuration CheckPhase completed.
Sat Aug 10 06:31:30 2013 - [info]
Sat Aug 10 06:31:30 2013 - [info] * Phase 2: Dead Master ShutdownPhase..
Sat Aug 10 06:31:30 2013 - [info]
Sat Aug 10 06:31:30 2013 - [info] Forcing shutdown so thatapplications never connect to the current master..
Sat Aug 10 06:31:30 2013 - [info] Executing master IPdeactivatation script:
Sat Aug 10 06:31:30 2013 -[info]
Sat Aug 10 06:31:31 2013 - [info]
Sat Aug 10 06:31:31 2013 - [warning] shutdown_script is not set.Skipping explicit shutting down of the dead master.
Sat Aug 10 06:31:31 2013 - [info] * Phase 2: Dead Master ShutdownPhase completed.
Sat Aug 10 06:31:31 2013 - [info]
Sat Aug 10 06:31:31 2013 - [info] * Phase 3: Master RecoveryPhase..
Sat Aug 10 06:31:31 2013 - [info]
Sat Aug 10 06:31:31 2013 - [info] * Phase 3.1: Getting LatestSlaves Phase..
Sat Aug 10 06:31:31 2013 - [info]
Sat Aug 10 06:31:31 2013 - [info] The latest binary logfile/position on all slaves is mysql-bin.000010:107
Sat Aug 10 06:31:31 2013 - [info] Latest slaves (Slaves thatreceived relay log files to the latest):
Sat Aug 10 06:31:31 2013 -[info]
Sat Aug 10 06:31:31 2013 -[info]
Sat Aug 10 06:31:31 2013 -[info]
Sat Aug 10 06:31:31 2013 -[info]
Sat Aug 10 06:31:31 2013 -[info]
Sat Aug 10 06:31:31 2013 -[info]
Sat Aug 10 06:31:31 2013 - [info] The oldest binary logfile/position on all slaves is mysql-bin.000010:107
Sat Aug 10 06:31:31 2013 - [info] Oldest slaves:
Sat Aug 10 06:31:31 2013 -[info]
Sat Aug 10 06:31:31 2013 -[info]
Sat Aug 10 06:31:31 2013 -[info]
Sat Aug 10 06:31:31 2013 -[info]
Sat Aug 10 06:31:31 2013 -[info]
Sat Aug 10 06:31:31 2013 -[info]
Sat Aug 10 06:31:31 2013 - [info]
Sat Aug 10 06:31:31 2013 - [info] * Phase 3.2: Saving Dead Master'sBinlog Phase..
Sat Aug 10 06:31:31 2013 - [info]
Sat Aug 10 06:31:31 2013 - [info] Fetching dead master's binarylogs..
Sat Aug 10 06:31:31 2013 - [info] Executing command on the deadmaster 192.168.8.120(192.168.8.120:3306): save_binary_logs--command=save --start_file=mysql-bin.000010
Sat Aug 10 06:31:32 2013 - [info] scp fromroot@192.168.8.120:/app/mha/saved_master_binlog_from_192.168.8.120_3306_20130810063130.binlogtolocal:/app/mha/saved_master_binlog_from_192.168.8.120_3306_20130810063130.binlogsucceeded.
Sat Aug 10 06:31:32 2013 - [info] HealthCheck: SSH to 192.168.8.121is reachable.
Sat Aug 10 06:31:33 2013 - [info] HealthCheck: SSH to 192.168.8.122is reachable.
Sat Aug 10 06:31:33 2013 - [info]
Sat Aug 10 06:31:33 2013 - [info] * Phase 3.3: Determining NewMaster Phase..
Sat Aug 10 06:31:33 2013 - [info]
Sat Aug 10 06:31:33 2013 - [info] Finding the latest slave that hasall relay logs for recovering other slaves..
Sat Aug 10 06:31:33 2013 - [info] All slaves received relay logs tothe same position. No need to resync each other.
Sat Aug 10 06:31:33 2013 - [info] Searching new master fromslaves..
Sat Aug 10 06:31:33 2013 - [info]
Sat Aug 10 06:31:33 2013 -[info]
Sat Aug 10 06:31:33 2013 -[info]
Sat Aug 10 06:31:33 2013 -[info]
Sat Aug 10 06:31:33 2013 - [info]
Sat Aug 10 06:31:33 2013 -[info]
Sat Aug 10 06:31:33 2013 -[info]
Sat Aug 10 06:31:33 2013 -[info]
Sat Aug 10 06:31:33 2013 - [info]
Sat Aug 10 06:31:33 2013 - [info] New master is192.168.8.121(192.168.8.121:3306)
Sat Aug 10 06:31:33 2013 - [info] Starting master failover..
Sat Aug 10 06:31:33 2013 - [info]
From:
192.168.8.120 (current master)
To:
192.168.8.121 (new master)
Sat Aug 10 06:31:33 2013 - [info]
Sat Aug 10 06:31:33 2013 - [info] * Phase 3.3: New Master Diff LogGeneration Phase..
Sat Aug 10 06:31:33 2013 - [info]
Sat Aug 10 06:31:33 2013 - [info]
Sat Aug 10 06:31:33 2013 - [info] Sending binlog..
Sat Aug 10 06:31:34 2013 - [info] scp fromlocal:/app/mha/saved_master_binlog_from_192.168.8.120_3306_20130810063130.binlogtoroot@192.168.8.121:/app/mha/saved_master_binlog_from_192.168.8.120_3306_20130810063130.binlogsucceeded.
Sat Aug 10 06:31:34 2013 - [info]
Sat Aug 10 06:31:34 2013 - [info] * Phase 3.4: Master Log ApplyPhase..
Sat Aug 10 06:31:34 2013 - [info]
Sat Aug 10 06:31:34 2013 - [info] *NOTICE: If any error happensfrom this phase, manual recovery is needed.
Sat Aug 10 06:31:34 2013 - [info] Starting recovery on192.168.8.121(192.168.8.121:3306)..
Sat Aug 10 06:31:34 2013 - [info]
Sat Aug 10 06:31:34 2013 - [info] Waiting until all relay logs areapplied.
Sat Aug 10 06:31:34 2013 - [info]
Sat Aug 10 06:31:34 2013 - [info] Getting slave status..
Sat Aug 10 06:31:34 2013 - [info] This slave(192.168.8.121)'sExec_Master_Log_Pos equals toRead_Master_Log_Pos(mysql-bin.000010:107). No need to recover fromExec_Master_Log_Pos.
Sat Aug 10 06:31:34 2013 - [info] Connecting to the target slavehost 192.168.8.121, running recover script..
Sat Aug 10 06:31:34 2013 - [info] Executing command:apply_diff_relay_logs --command=apply --slave_user=root--slave_host=192.168.8.121--slave_ip=192.168.8.121