版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領
文檔簡介
1、rootdg55#yum-yinstallperl-Config-Tinyperl-Params-Validateperl-Log-Dispatchperl-Parallel-rootdg55 # wgetrootdg55#yum-yinstallperl-Config-Tinyperl-Params-Validateperl-Log-Dispatchperl-Parallel-rootdg55 # wget-manager-0.52.tar.gz-P/usr/l 二:管理節(jié)1:按照步驟一mha 2:安裝mharootdg53# rpm -warning:/var/tmp/rpm-xfer.y
2、qwfYT:HeaderV3DSAsignature:NOKEY,keyID217521f6 # 100%1:epel-rootdg53#lsbase.repo epel.repo epel-testing.repo rhel-rootdg53#yum-yinstallperl-rootdg53 # wget-node-0.52.tar.gz-P/usr/loc rootdg53#cdrootdg53tarbag#tar-zxvpf-node-0.52.tar.gz-Crootdg53tarbag#cd-node-rootdg53 -node-0.52#perlrootdg53 -node-0
3、.52#make&make點;管理節(jié)點的角色類似于 oracle 數(shù)據(jù)庫中的 fast start failover 中的observer,但 mha 上層可以通過 keepalive 部署 程序連接數(shù)據(jù)庫使用VIP,從而實現(xiàn)MHA 節(jié)點包含三個,依賴 perl 模塊; apply_diff_relay_logs:識別差異的 relay log 事件,并應用于其他 salve 服務器purge_relay_logs:清除relaylog件需要在所服務器上安裝MHA 節(jié)點,MHA管理服務器也需要安裝。MHA管理節(jié)點模依賴MHA 節(jié)點模塊MHA 管理節(jié)點通過 ssh 連接管理服務器和執(zhí)行 MHA
4、節(jié)點。MHA 節(jié)點依賴 perl 的 DBD:本文環(huán)境介紹,操作系統(tǒng)均為rhel5.4管理節(jié)點在開始之前,請先配置好服務器間的時間同步和名稱一:在數(shù)據(jù)庫節(jié)點安裝mha nodeMHA 分管理節(jié)點和數(shù)據(jù)庫節(jié)點,數(shù)據(jù)庫節(jié)點,當主庫掛掉后,管理節(jié)點會自動將從節(jié)為主 rootdg55#ssh-keygen-trootdg55#ssh-copy-idrootdg55#ssh-keygen-trootdg55#ssh-copy-id-i/root/.ssh/id_rsa.pub HYPERLINK mailto:root3 rootdg55#ssh-copy-id-i/root/.ssh/id_rsa.p
5、ub HYPERLINK mailto:root4 root4 rootdg55#ssh3ifconfig|grepinetaddr|head-inetaddr:3 Bcast:55 rootdg55#ssh4ifconfig|grepinetaddr|head-inetaddr:4 Bcast:55 4:配置manager 節(jié)點和 node 節(jié)點以及 node 節(jié)點間的ssh rootdg55 -manager-0.52# mkdir rootdg55 -manager-0.52#mkdir-prootdg55 -manager-0.52#cples/conf/*rootdg55 -mana
6、ger-0.52#catserver19. 23. 3:rootdg55#cdrootdg55tarbag#tar-zxvpf-manager-0.52.tar.gz-Crootdg55tarbag# cd -manager-rootdg55 -manager-0.52#perlrootdg55 -manager-0.52#make&makeselectuser,host,password-selectuser,host,password-| user| host| password-|10. 11. |r_test|4|*6BB4837EB74329105EE4568DDA7DC67ED2C
7、A2AD912. -13. 7rowsinset(0.08sec) updateusersethost=192.168.123.%whereQueryOK,1rowaffected(0.05Rowsmatched:1 Changed:1 Warnings:0 QueryOK,0rowsaffected(0.01sec) 6:測試主情況,默認使用 root 用戶連 Wed Jun 6 11:11:25 2012 - warning Global configuration file /etc/mafnotfound.Ski WedJun 611:11:252012-infoReadingappl
8、icationdefaultconfigurationsfrom/etc WedJun 611:11:252012-infoReadingserverconfigurationsfromWedJun 611:11:252012-infoStartingSSHconnectionWedJun 611:11:252012-WedJun 611:11:252012 -debug ConnectingviaSSHfromroot3(3) toroot WedJun 611:11:252012-WedJun 611:11:262012-10. WedJun 611:11:252012-debug Con
9、nectingviaSSHfromroot4(4)toroot 11. WedJun 611:11:262012 -12. WedJun 611:11:262012-infoAll SSHconnectiontestspassed5:測試ssh updateusersethost=192.168.123.%wherehost=localhostanduser=rootandQueryOK,0rowsaffected(0.00Rowsmatched:1 Changed:1 Warnings:updateusersetpassword=PASSWORD(123456)whereuser=roota
10、ndQueryOK,0rowsaffected(0.00Rowsmatched:1 Changed:0 Warnings:flushQueryOK,0rowsaffected(0.02rootdg53#binlog:updateusersethost=192.168.123.%wherehost=localhostanduser=rootandQueryOK,0rowsaffected(0.00Rowsmatched:1 Changed:1 Warnings:updateusersetpassword=PASSWORD(123456)whereuser=rootandQueryOK,0rows
11、affected(0.00Rowsmatched:1 Changed:0 Warnings:flushQueryOK,0rowsaffected(0.02rootdg53#binlog:rootdg53#mvysql*rootdg54#mvysql*rootdg53#ln-s5.5.25/bin/*rootdg54#ln-s5.5.25/bin/* fWed612:39:03-warningGlobalconfigurationfilefnotfound.p.Wed612:39:03-infoReadingapplicationdefaultconfigurationsfromWed612:3
12、9:03-infoReadingserverconfigurationsfromWed612:39:03-infoMHA:MasterMonitorWed612:39:03-infoDeadWed612:39:03-infoAliveWed612:39:03-Wed612:39:03-Wed612:39:03-infoAliveWed612:39:03-4(4:3306) =5.5.25-log(oldestornslaves)log-Wed612:39:03-ReplicatingfromWed612:39:03-PrimarycandidateforthenewMaster(candida
13、te_masterisWed612:39:03-infoCurrentAliveMaster:Wed612:39:03-infoCheckingslaveWed612:39:03-warning read_only=1isnotsetonslaveWed612:39:03-warning relay_log_purge=0isnotsetonslaveWed612:39:03-infoCheckingreplicationfilteringWed612:39:03-info ,test,Wed612:39:03-info ReplicationfilteringcheckWed612:39:0
14、3-infoStartingSSHconnection2&1rootdg55#nohup2&1rootdg55#nohupmasterha_manager-f/tmp/mha_manager.log showslave-|Server_id|Host|Port|Master_id| -2|33061-1rowinset(0.00sec) rootdg53#dShutting. OK 1:當前主庫為 3,關閉三:測試failover1rootdg55 # masterha_check_sus -conf=/etcapp1 (:25516) is running(0:_OK), master:3
15、fandfagain,andtryingtoconnecttoallserverstocheckservers Wed 614:51:352012-warningGlobalconfigurationfilefnotfound.Wed 614:51:352012-infoReadingapplicationdefaultconfigurations fandfagain,andtryingtoconnecttoallserverstocheckservers Wed 614:51:352012-warningGlobalconfigurationfilefnotfound.Wed 614:51
16、:352012-infoReadingapplicationdefaultconfigurationsfromWed 614:51:352012-infoReadingserverconfigurationsfromWed 614:51:352012-infoDeadWed 614:51:352012-Wed 614:51:352012-infoAliveWed 614:51:352012-Wed 614:51:352012-infoAliveWed614:51:352012-4(4:3306) =5.5.25-log(oldestmajornslaves) log-Wed 614:51:35
17、2012-ReplicatingfromWed 614:51:352012-PrimarycandidateforthenewMaster(candidate_masterisWed 614:51:352012-infoCheckingslaveWed 614:51:352012-warning read_only=1isnotsetonslaveWed 614:51:352012-warning relay_log_purge=0isnotsetonslaveWed 614:51:352012-infoCheckingreplicationfilteringWed 614:51:352012
18、-ReplicationfilteringcheckWed 614:51:352012-infoMasterisWed 614:51:352012-infoTerminatingmonitoringWed 614:51:352012-infoGotexitcode20(MasterWed 614:51:352012-infoMHA:MasterFailoverWed 614:51:352012-infoStartingmasterWed 614:51:352012-Wed 614:51:352012-info*Phase1:ConfigurationCheckWed 614:51:352012
19、-Wed 614:51:352012-infoDeadWed 614:51:352012-Wed 614:51:352012-infoCheckingmasterreachability(doubleWed 614:51:352012-Wed 614:51:352012-infoAliveWed 614:51:352012-Wed 614:51:352012-infoAliveWed614:51:352012-4(4:3306) =5.5.25-log(oldestmajornslaves) log-Wed 614:51:352012-ReplicatingfromWed 614:51:352
20、012-PrimarycandidateforthenewMaster(candidate_masterisWed 614:51:352012-info*Phase1:ConfigurationCheckPhaseWed 614:51:352012-Wed 614:51:352012-info*Phase2:DeadMasterShutdownWed 614:51:352012-Wed 614:51:352012-infoForcingshutdowntapplicationsneverconnecttothecurrentWed 614:51:352012-warningmaster_ip_
21、failover_scriptisnotset.invalidatingdeadmasteripWed 614:51:352012-warningshutdown_scriptisnotset.explicitshuttingdownofthedeadWed 614:51:352012-info*Phase2:DeadMasterShutdownPhaseWed 614:51:352012-Wed 614:51:352012-info*Phase3:MasterRecoveryWed 614:51:352012-WedWed 614:51:352012-warningshutdown_scri
22、ptisnotset.explicitshuttingdownofthedeadWed 614:51:352012-info*Phase2:DeadMasterShutdownPhaseWed 614:51:352012-Wed 614:51:352012-info*Phase3:MasterRecoveryWed 614:51:352012-Wed 614:51:352012-info*Phase3.1:GettingLatestSlavesWed 614:51:352012-Wed 614:51:352012-infoThelatestbinarylogfile/ itiononallsl
23、avesWed 614:51:352012-infoLatestslavestreceivedrelaylogfilestotheWed614:51:352012-4(4:3306) =5.5.25-log(oldestmajornslaves) log-Wed 614:51:352012-ReplicatingfromWed 614:51:352012-PrimarycandidateforthenewMaster(candidate_masterisWed 614:51:352012-infoTheoldestbinarylogfile/ itiononallslavesWed 614:5
24、1:352012-infoOldestWed614:51:352012-4(4:3306) =5.5.25-log(oldestmajornslaves) log-Wed 614:51:352012-ReplicatingfromWed 614:51:352012-PrimarycandidateforthenewMaster(candidate_masterisWed 614:51:352012-Wed 614:51:352012-info*Phase3.2:SavingDeadMastersBinlogWed 614:51:352012-Wed 614:51:352012-infoFetc
25、hingdeadmastersbinaryWed614:51:352012-infod on the dead master 3(3:3306): mand=save -bin.000021 -start_ =107- Creating/var/tmpifnotConcatbinary/relaylogs107-bin.000021obinlogformatdescriptionevent,ition0to107.effectivebinlogdatafrom-ition107totail(126).ConcatWedJun 614:51:362012 -infoWed 614:51:3620
26、12-infoHealthCheck:SSHto4isWed 614:51:372012-Wed 614:51:372012-info*Phase3.3:DeterminingNewWed 614:51:372012-Wed 614:51:372012-infoFindingthelatestsallrelaylogsforrecoveringotherWed 614:51:372012-infoAllslavesreceivedrelaylogstotheition.NoneedtoresynceachWed 614:51:372012-infoSearchingnewmasterfromW
27、ed 614:51:372012-CandidatemastersfromtheconfigurationWedJun 614:51:372012-4(4:3306) =5.5.25-log(oldestmajorbet slaves) log-Wed 614:51:372012-ReplicatingfromWed 614:51:372012-PrimarycandidateforthenewMaster(candidate_masterisWed 614:51:372012-Non-candidate WedWedJun 614:51:372012-4(4:3306) =5.5.25-lo
28、g(oldestmajorbet slaves) log-Wed 614:51:372012-ReplicatingfromWed 614:51:372012-PrimarycandidateforthenewMaster(candidate_masterisWed 614:51:372012-Non-candidate Wed614:51:372012-Searchingfromcandidate_masterslaveswhichhavereceivedthelatestrelaylogWed 614:51:372012-infoNewmasterisWed 614:51:372012-i
29、nfoStartingmasterWed 614:51:372012-3 (current +- Wed 614:51:372012-Wed 614:51:372012-info*Phase3.3:NewMasterDiffLogGenerationWed 614:51:372012-Wed614:51:372012-info Thisserverhasallrelaylogs.NoneedtogenerateilesfromthelatestWed 614:51:372012-infoSendingWed 614:51:372012-infoscpWed 614:51:372012-Wed
30、614:51:372012-info*Phase3.4:MasterLogApplyWed 614:51:372012-Wed 614:51:372012-info*NOTICE:Ifanyerrorhappensfromthisphase,manualrecoveryisWed 614:51:372012-infoStartingrecoveryonWed 614:51:372012-GeneratingWed 614:51:372012-infoWaitinguntilallrelaylogsareapp Wed 614:51:372012-Wed 614:51:372012-infoGe
31、ttingslaves Wed 614:51:372012-infoThisslave(4)sequalsRead_Master_Log_ -bin.000021:107).NoneedtorecoverfromExec_Master_Log_ WedJun 614:51:372012-infoConnectingtoslavehost4,runningrecoverWedJun 614:51:372012-infod:mand=apply-slave_host=4-slave_ip=4 - -WedJun 614:51:372012 -Applying differential binary
32、/relay log files /var/tmp/saved_master_binlog_from_3_3306_20120606145135.binlog 4:3306.ThismaytakelongApplyinglogWedJun 614:51:372012 -Allrelaylogsweresuc sfullyapp showmaster- showmaster- | Fileition|Binlog_Do_DB|Binlog_Ignore_DB| - -bin.000023107- 1rowinset(0.003:在原從庫4 上查看結(jié)Wed Jun 6 14:51:37 2012
33、- info Getting new masters binlog name andWed Jun 6 14:51:37 2012 - infoWedJun 614:51:372012-info Allotherslavesshouldstartreplicationfromhere.S ementshouldbe:CHANGEMASTER TO MASTER_HOST=4, MASTER_PORT=3306, MASTER_LOG_FILE=-bin.000023, MASTER_LOG_ =107, MASTER_USER=r_test, MASTER_PASSWORD= ;Wed Jun
34、 6 14:51:37 2012 - warning master_ip_failover_script is not set. Skipernewmasteripaddress. Wed Jun 6 14:51:37 2012 - info * Finished master recovery suc sfully.WedJun 614:51:372012-info*Phase3:MasterRecoveryPhasecompleted. Wed Jun 6 14:51:37 2012 - infoWedJun 614:51:372012-info*Phase4:SlavesRecovery
35、WedJun 614:51:372012 -WedJun 614:51:372012-info*Phase4.1:StartingParallelSlaveDiffLogGenerationPhase. Wed Jun 6 14:51:37 2012 - infoWed Jun 6 14:51:37 2012 - info Generating relay diilesfromthelatestslavesucceeded. Wed Jun 6 14:51:37 2012 - infoWedJun 614:51:372012-info*Phase4.2:StartingParallelSlaveLogApplyPhase. Wed Jun 6 14:51:37 2012 - infoWedJun 614:51:372012-infoAllnewslaveserversrecoveredsuc sfully. Wed Jun 6 14:51:37 2012 - infoWedJun 614:51:372012-info*Phase5:Newmaster
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- R市增值稅留抵退稅政策執(zhí)行機制研究
- 企業(yè)數(shù)據(jù)商業(yè)秘密法律保護問題研究
- 2025訂貨合同范文模板
- 二零二四年噪音治理與商業(yè)街區(qū)噪音控制合同3篇
- 洛陽二零二五年度租賃房屋租賃合同解除協(xié)議4篇
- 2025年度模具行業(yè)科技成果轉(zhuǎn)化合作協(xié)議4篇
- DLC1對結(jié)直腸癌增殖、遷移功能及自噬相關因子的影響
- 平房倉雙層通風屋頂構(gòu)造優(yōu)化設計與應用區(qū)劃
- 基于幾何先驗的特征匹配方法研究與應用
- 四年級數(shù)學(四則混合運算帶括號)計算題專項練習與答案
- 橋梁監(jiān)測監(jiān)控實施方案
- 書籍小兵張嘎課件
- 藝術哲學:美是如何誕生的學習通超星期末考試答案章節(jié)答案2024年
- 北京海淀區(qū)2025屆高三下第一次模擬語文試題含解析
- 量子醫(yī)學治療學行業(yè)投資機會分析與策略研究報告
- 多重耐藥菌病人的管理-(1)課件
- (高清版)TDT 1056-2019 縣級國土資源調(diào)查生產(chǎn)成本定額
- 環(huán)境監(jiān)測對環(huán)境保護的意義
- 2023年數(shù)學競賽AMC8試卷(含答案)
- 神經(jīng)外科課件:神經(jīng)外科急重癥
- 2023年十天突破公務員面試
評論
0/150
提交評論