



下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
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點(diǎn);管理節(jié)點(diǎn)的角色類似于 oracle 數(shù)據(jù)庫中的 fast start failover 中的observer,但 mha 上層可以通過 keepalive 部署 程序連接數(shù)據(jù)庫使用VIP,從而實(shí)現(xiàn)MHA 節(jié)點(diǎn)包含三個(gè),依賴 perl 模塊; apply_diff_relay_logs:識(shí)別差異的 relay log 事件,并應(yīng)用于其他 salve 服務(wù)器purge_relay_logs:清除relaylog件需要在所服務(wù)器上安裝MHA 節(jié)點(diǎn),MHA管理服務(wù)器也需要安裝。MHA管理節(jié)點(diǎn)模依賴MHA 節(jié)點(diǎn)模塊MHA 管理節(jié)點(diǎn)通過 ssh 連接管理服務(wù)器和執(zhí)行 MHA
4、節(jié)點(diǎn)。MHA 節(jié)點(diǎn)依賴 perl 的 DBD:本文環(huán)境介紹,操作系統(tǒng)均為rhel5.4管理節(jié)點(diǎn)在開始之前,請(qǐng)先配置好服務(wù)器間的時(shí)間同步和名稱一:在數(shù)據(jù)庫節(jié)點(diǎn)安裝mha nodeMHA 分管理節(jié)點(diǎn)和數(shù)據(jù)庫節(jié)點(diǎn),數(shù)據(jù)庫節(jié)點(diǎn),當(dāng)主庫掛掉后,管理節(jié)點(diǎn)會(huì)自動(dòng)將從節(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é)點(diǎn)和 node 節(jié)點(diǎn)以及 node 節(jié)點(diǎn)間的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:測試主情況,默認(rèn)使用 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:當(dāng)前主庫為 3,關(guān)閉三:測試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等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 植物基蛋白產(chǎn)品標(biāo)準(zhǔn)認(rèn)證顧問服務(wù)合同二零二五
- 幼兒園小班第一學(xué)期班級(jí)保教工作計(jì)劃11篇
- 2025企業(yè)間借款合同范本
- 農(nóng)村培訓(xùn)協(xié)議合同標(biāo)準(zhǔn)文本
- 幼兒園端午節(jié)教學(xué)活動(dòng)方案7篇
- eps聚苯板銷售合同標(biāo)準(zhǔn)文本
- 出租車服務(wù)規(guī)范
- 借款合同標(biāo)準(zhǔn)文本簽名蓋章
- 會(huì)計(jì)盡職調(diào)查合同標(biāo)準(zhǔn)文本
- 電工作業(yè)考證實(shí)訓(xùn)項(xiàng)目七三相異步電動(dòng)機(jī)按鈕接觸器雙重互鎖正反
- 車間溫濕度測量記錄表
- 醫(yī)院醫(yī)療機(jī)構(gòu)麻醉科醫(yī)生招聘考試試題與答案
- 混凝土模板支撐工程專項(xiàng)施工方案(140頁)
- 簡述中國現(xiàn)當(dāng)代文學(xué)中的“現(xiàn)代性”(一)
- 變電所倒閘操作課件
- 光纜的敷設(shè)方法與要求
- [精品]紡織品出口生產(chǎn)企業(yè)(MID)報(bào)編申請(qǐng)表
- 3130簡明使用手冊(cè)
- 藥品出廠、上市放行管理規(guī)程
- 中醫(yī)基礎(chǔ)理論·緒論課件
- (完整版)小學(xué)生必背古詩75首(打印版).docx
評(píng)論
0/150
提交評(píng)論