1、切換過程,注意需要關(guān)閉masterha_manager
寧洱ssl適用于網(wǎng)站、小程序/APP、API接口等需要進(jìn)行數(shù)據(jù)傳輸應(yīng)用場(chǎng)景,ssl證書未來市場(chǎng)廣闊!成為創(chuàng)新互聯(lián)的ssl證書銷售渠道,可以享受市場(chǎng)價(jià)格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:18980820575(備注:SSL證書合作)期待與您的合作![root@es3?~]#??masterha_master_switch?--master_state=alive?--conf=/root/app1.cnf?--new_master_host=es3?--orig_master_is_new_slave Tue?Aug?20?10:12:02?2019?-?[info]?MHA::MasterRotate?version?0.58. Tue?Aug?20?10:12:02?2019?-?[info]?Starting?online?master?switch.. Tue?Aug?20?10:12:02?2019?-?[info]? Tue?Aug?20?10:12:02?2019?-?[info]?*?Phase?1:?Configuration?Check?Phase.. Tue?Aug?20?10:12:02?2019?-?[info]? Tue?Aug?20?10:12:02?2019?-?[warning]?Global?configuration?file?/etc/masterha_default.cnf?not?found.?Skipping. Tue?Aug?20?10:12:02?2019?-?[info]?Reading?application?default?configuration?from?/root/app1.cnf.. Tue?Aug?20?10:12:02?2019?-?[info]?Reading?server?configuration?from?/root/app1.cnf.. Tue?Aug?20?10:12:03?2019?-?[info]?GTID?failover?mode?=?1 Tue?Aug?20?10:12:03?2019?-?[info]?Current?Alive?Master:?es1(192.168.56.14:3306) Tue?Aug?20?10:12:03?2019?-?[info]?Alive?Slaves: Tue?Aug?20?10:12:03?2019?-?[info]???es2(192.168.56.15:3306)??Version=5.7.24-log?(oldest?major?version?between?slaves)?log-bin:enabled Tue?Aug?20?10:12:03?2019?-?[info]?????GTID?ON Tue?Aug?20?10:12:03?2019?-?[info]?????Replicating?from?192.168.56.14(192.168.56.14:3306) Tue?Aug?20?10:12:03?2019?-?[info]???es3(192.168.56.16:3306)??Version=5.7.24-log?(oldest?major?version?between?slaves)?log-bin:enabled Tue?Aug?20?10:12:03?2019?-?[info]?????GTID?ON Tue?Aug?20?10:12:03?2019?-?[info]?????Replicating?from?es1(192.168.56.14:3306) It?is?better?to?execute?FLUSH?NO_WRITE_TO_BINLOG?TABLES?on?the?master?before?switching.?Is?it?ok?to?execute?on?es1(192.168.56.14:3306)??(YES/no):?yes Tue?Aug?20?10:12:06?2019?-?[info]?Executing?FLUSH?NO_WRITE_TO_BINLOG?TABLES.?This?may?take?long?time.. Tue?Aug?20?10:12:06?2019?-?[info]??ok. Tue?Aug?20?10:12:06?2019?-?[info]?Checking?MHA?is?not?monitoring?or?doing?failover.. Tue?Aug?20?10:12:06?2019?-?[info]?Checking?replication?health?on?es2.. Tue?Aug?20?10:12:06?2019?-?[info]??ok. Tue?Aug?20?10:12:06?2019?-?[info]?Checking?replication?health?on?es3.. Tue?Aug?20?10:12:06?2019?-?[info]??ok. Tue?Aug?20?10:12:06?2019?-?[info]?es3?can?be?new?master. Tue?Aug?20?10:12:06?2019?-?[info]? From: es1(192.168.56.14:3306)?(current?master) ?+--es2(192.168.56.15:3306) ?+--es3(192.168.56.16:3306) To: es3(192.168.56.16:3306)?(new?master) ?+--es2(192.168.56.15:3306) ?+--es1(192.168.56.14:3306) Starting?master?switch?from?es1(192.168.56.14:3306)?to?es3(192.168.56.16:3306)??(yes/NO):?yes Tue?Aug?20?10:12:11?2019?-?[info]?Checking?whether?es3(192.168.56.16:3306)?is?ok?for?the?new?master.. Tue?Aug?20?10:12:11?2019?-?[info]??ok. Tue?Aug?20?10:12:11?2019?-?[info]?es1(192.168.56.14:3306):?SHOW?SLAVE?STATUS?returned?empty?result.?To?check?replication?filtering?rules,?temporarily?executing?CHANGE?MASTER?to?a?dummy?host. Tue?Aug?20?10:12:11?2019?-?[info]?es1(192.168.56.14:3306):?Resetting?slave?pointing?to?the?dummy?host. Tue?Aug?20?10:12:11?2019?-?[info]?**?Phase?1:?Configuration?Check?Phase?completed. Tue?Aug?20?10:12:11?2019?-?[info]? Tue?Aug?20?10:12:11?2019?-?[info]?*?Phase?2:?Rejecting?updates?Phase.. Tue?Aug?20?10:12:11?2019?-?[info]? Tue?Aug?20?10:12:11?2019?-?[info]?Executing?master?ip?online?change?script?to?disable?write?on?the?current?master: Tue?Aug?20?10:12:11?2019?-?[info]???/usr/local/bin/master_ip_online_change?--command=stop?--orig_master_host=es1?--orig_master_ip=192.168.56.14?--orig_master_port=3306?--orig_master_user='repl'?--new_master_host=es3?--new_master_ip=192.168.56.16?--new_master_port=3306?--new_master_user='repl'?--orig_master_ssh_user=root?--new_master_ssh_user=root???--orig_master_is_new_slave?--orig_master_password=xxx?--new_master_password=xxx *************************************************************** Disabling?the?VIP?-?192.168.56.191/24?on?old?master:?es1 *************************************************************** Tue?Aug?20?10:12:12?2019?-?[info]??ok. Tue?Aug?20?10:12:12?2019?-?[info]?Locking?all?tables?on?the?orig?master?to?reject?updates?from?everybody?(including?root): Tue?Aug?20?10:12:12?2019?-?[info]?Executing?FLUSH?TABLES?WITH?READ?LOCK.. Tue?Aug?20?10:12:12?2019?-?[info]??ok. Tue?Aug?20?10:12:12?2019?-?[info]?Orig?master?binlog:pos?is?mysqlbin.000005:194. Tue?Aug?20?10:12:12?2019?-?[info]??Waiting?to?execute?all?relay?logs?on?es3(192.168.56.16:3306).. Tue?Aug?20?10:12:12?2019?-?[info]??master_pos_wait(mysqlbin.000005:194)?completed?on?es3(192.168.56.16:3306).?Executed?0?events. Tue?Aug?20?10:12:12?2019?-?[info]???done. Tue?Aug?20?10:12:12?2019?-?[info]?Getting?new?master's?binlog?name?and?position.. Tue?Aug?20?10:12:12?2019?-?[info]??mysqlbin.000004:154 Tue?Aug?20?10:12:12?2019?-?[info]??All?other?slaves?should?start?replication?from?here.?Statement?should?be:?CHANGE?MASTER?TO?MASTER_HOST='es3?or?192.168.56.16',?MASTER_PORT=3306,?MASTER_AUTO_POSITION=1,?MASTER_USER='repl',?MASTER_PASSWORD='xxx'; Tue?Aug?20?10:12:12?2019?-?[info]?Executing?master?ip?online?change?script?to?allow?write?on?the?new?master: Tue?Aug?20?10:12:12?2019?-?[info]???/usr/local/bin/master_ip_online_change?--command=start?--orig_master_host=es1?--orig_master_ip=192.168.56.14?--orig_master_port=3306?--orig_master_user='repl'?--new_master_host=es3?--new_master_ip=192.168.56.16?--new_master_port=3306?--new_master_user='repl'?--orig_master_ssh_user=root?--new_master_ssh_user=root???--orig_master_is_new_slave?--orig_master_password=xxx?--new_master_password=xxx *************************************************************** Enabling?the?VIP?-?192.168.56.191/24?on?new?master:?es3? *************************************************************** Tue?Aug?20?10:12:13?2019?-?[info]??ok. Tue?Aug?20?10:12:13?2019?-?[info]? Tue?Aug?20?10:12:13?2019?-?[info]?*?Switching?slaves?in?parallel.. Tue?Aug?20?10:12:13?2019?-?[info]? Tue?Aug?20?10:12:13?2019?-?[info]?--?Slave?switch?on?host?es2(192.168.56.15:3306)?started,?pid:?4076 Tue?Aug?20?10:12:13?2019?-?[info]? Tue?Aug?20?10:12:14?2019?-?[info]?Log?messages?from?es2?... Tue?Aug?20?10:12:14?2019?-?[info]? Tue?Aug?20?10:12:13?2019?-?[info]??Waiting?to?execute?all?relay?logs?on?es2(192.168.56.15:3306).. Tue?Aug?20?10:12:13?2019?-?[info]??master_pos_wait(mysqlbin.000005:194)?completed?on?es2(192.168.56.15:3306).?Executed?0?events. Tue?Aug?20?10:12:13?2019?-?[info]???done. Tue?Aug?20?10:12:13?2019?-?[info]??Resetting?slave?es2(192.168.56.15:3306)?and?starting?replication?from?the?new?master?es3(192.168.56.16:3306).. Tue?Aug?20?10:12:13?2019?-?[info]??Executed?CHANGE?MASTER. Tue?Aug?20?10:12:13?2019?-?[info]??Slave?started. Tue?Aug?20?10:12:14?2019?-?[info]?End?of?log?messages?from?es2?... Tue?Aug?20?10:12:14?2019?-?[info]? Tue?Aug?20?10:12:14?2019?-?[info]?--?Slave?switch?on?host?es2(192.168.56.15:3306)?succeeded. Tue?Aug?20?10:12:14?2019?-?[info]?Unlocking?all?tables?on?the?orig?master: Tue?Aug?20?10:12:14?2019?-?[info]?Executing?UNLOCK?TABLES.. Tue?Aug?20?10:12:14?2019?-?[info]??ok. Tue?Aug?20?10:12:14?2019?-?[info]?Starting?orig?master?as?a?new?slave.. Tue?Aug?20?10:12:14?2019?-?[info]??Resetting?slave?es1(192.168.56.14:3306)?and?starting?replication?from?the?new?master?es3(192.168.56.16:3306).. Tue?Aug?20?10:12:14?2019?-?[info]??Executed?CHANGE?MASTER. Tue?Aug?20?10:12:14?2019?-?[info]??Slave?started. Tue?Aug?20?10:12:14?2019?-?[info]?All?new?slave?servers?switched?successfully. Tue?Aug?20?10:12:14?2019?-?[info]? Tue?Aug?20?10:12:14?2019?-?[info]?*?Phase?5:?New?master?cleanup?phase.. Tue?Aug?20?10:12:14?2019?-?[info]? Tue?Aug?20?10:12:14?2019?-?[info]??es3:?Resetting?slave?info?succeeded. Tue?Aug?20?10:12:14?2019?-?[info]?Switching?master?to?es3(192.168.56.16:3306)?completed?successfully. [root@es3?~]#?ip?addr 1:?lo:?另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。