MHA 在线切换过程(二)

2015-07-16 12:09:31 · 作者: · 浏览: 1
(192.168.1.8:3306). Executed 0 events.
Tue Apr 21 15:42:13 2015 - [info]? done.
Tue Apr 21 15:42:13 2015 - [info] Getting new master's binlog name and position..
Tue Apr 21 15:42:13 2015 - [info]? mysql-bin.000016:301477519
Tue Apr 21 15:42:13 2015 - [info]? All other slaves should start replication from here. Statement should be:
? ? CHANGE MASTER TO MASTER_HOST='vdbsrv3 or 192.168.1.8', MASTER_PORT=3306, MASTER_LOG_FILE='mysql-bin.000016',
? ? MASTER_LOG_POS=301477519, MASTER_USER='repl', MASTER_PASSWORD='xxx';
Tue Apr 21 15:42:13 2015 - [info]
Tue Apr 21 15:42:13 2015 - [info] * Switching slaves in parallel..
Tue Apr 21 15:42:13 2015 - [info]
Tue Apr 21 15:42:13 2015 - [info] -- Slave switch on host vdbsrv2(192.168.1.7:3306) started, pid: 13099
Tue Apr 21 15:42:13 2015 - [info]
Tue Apr 21 15:42:13 2015 - [info] Log messages from vdbsrv2 ...
Tue Apr 21 15:42:13 2015 - [info]
Tue Apr 21 15:42:13 2015 - [info]? Waiting to execute all relay logs on vdbsrv2(192.168.1.7:3306)..
Tue Apr 21 15:42:13 2015 - [info]? master_pos_wait(mysql-bin.000023:651371104) completed on vdbsrv2(192.168.1.7:3306). Executed 0 events.
Tue Apr 21 15:42:13 2015 - [info]? done.
Tue Apr 21 15:42:13 2015 - [info]? Resetting slave vdbsrv2(192.168.1.7:3306) and starting replication from the new master vdbsrv3(192.168.1.8:3306)..
Tue Apr 21 15:42:13 2015 - [info]? Executed CHANGE MASTER.
Tue Apr 21 15:42:13 2015 - [info]? Slave started.
Tue Apr 21 15:42:13 2015 - [info] End of log messages from vdbsrv2 ...
Tue Apr 21 15:42:13 2015 - [info]
Tue Apr 21 15:42:13 2015 - [info] -- Slave switch on host vdbsrv2(192.168.1.7:3306) succeeded.
Tue Apr 21 15:42:13 2015 - [info] Unlocking all tables on the orig master:
Tue Apr 21 15:42:13 2015 - [info] Executing UNLOCK TABLES..
Tue Apr 21 15:42:13 2015 - [info]? ok.
Tue Apr 21 15:42:13 2015 - [info] Starting orig master as a new slave..
Tue Apr 21 15:42:13 2015 - [info]? Resetting slave vdbsrv1(192.168.1.6:3306) and starting replication from the new master vdbsrv3(192.168.1.8:3306)..
Tue Apr 21 15:42:13 2015 - [info]? Executed CHANGE MASTER.
Tue Apr 21 15:42:13 2015 - [info]? Slave started.
Tue Apr 21 15:42:13 2015 - [info] All new slave servers switched successfully.
Tue Apr 21 15:42:13 2015 - [info]
Tue Apr 21 15:42:13 2015 - [info] * Phase 5: New master cleanup phase..
Tue Apr 21 15:42:13 2015 - [info]
Tue Apr 21 15:42:13 2015 - [info]? vdbsrv3: Resetting slave info succeeded.
Tue Apr 21 15:42:13 2015 - [info] Switching master to vdbsrv3(192.168.1.8:3306) completed successfully.


###切换结果
mysql> show slave hosts;
+-----------+---------+------+-----------+--------------------------------------+
| Server_id | Host? ? | Port | Master_id | Slave_UUID? ? ? ? ? ? ? ? ? ? ? ? ? |
+-----------+---------+------+-----------+--------------------------------------+
|? ? ? ? 1 | vdbsrv1 | 3306 |? ? ? 1002 | f2824060-e2cb-11e4-8f18-000c2926f457 |
|? ? ? 1001 | vdbsrv2 | 3306 |? ? ? 1002 | 75bef614-e342-11e4-921d-000c295fb2eb |
+-----------+---------+------+-----------+--------------------------------------+