資源描述:
《linux下自帶雙機(jī)服務(wù)heartbeat的配置》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在行業(yè)資料-天天文庫。
1、linux下自帶雙機(jī)服務(wù)heartbeat的配置首先要安裝heartbeat服務(wù)所需要的補(bǔ)丁包,如果在你的linux系統(tǒng)下可以連接到外網(wǎng),那么就可以使用云安裝的形式其命令如下:yuminstallheartbeat-*這樣的安裝方法雖然簡單但是會(huì)把一些不必要的補(bǔ)丁全部安裝,要求必須可以連接到外網(wǎng),還有一種方法就是先把heartbeat所需的補(bǔ)丁包全部下載到移動(dòng)設(shè)備,再傳送到需要安裝的linux系統(tǒng),可以使用如下命令來安裝;rpm-ivhheartbeat-gui-2.1.3-3.el5.centos.i386.rpmrpm-ivhheartbeat-pils-
2、2.1.3-3.el5.centos.i386.rpmrpm-ivhheartbeat-stonith-2.1.3-3.el5.centos.i386.rpmrpm-ivhheartbeat-2.1.3-3.el5.centos.i386.rpmrpm-ivhheartbeat-devel-2.1.3-3.el5.centos.i386.rpm以上這幾個(gè)包就是heartbeat服務(wù)所需要的補(bǔ)丁包,安裝順序也必須相同如有安裝不上的包重復(fù)安裝幾次即可。其次在安裝完所有的heartbeat補(bǔ)丁包后cp/usr/share/doc/heartbeat-2.1.3/ha
3、.cfharesourcesauthkeys/etc/ha.d/。配置以下文件/etc/ha.d/ha.cf##Therearelotsofoptionsinthisfile.Allyouhavetohaveisaset#ofnodeslisted{"node...}oneof{serial,bcast,mcast,orucast},#andavaluefor"auto_failback".##ATTENTION:Astheconfigurationfileisreadlinebyline,#THEORDEROFDIRECTIVEMATTERS!##Inpar
4、ticular,makesurethattheudpport,serialbaudrate#etc.aresetbeforetheheartbeatmediaaredefined!#debugandlogfiledirectivesgointoeffectwhenthey#areencountered.##Allwillbefineifyoukeepthemorderedasinthisexample.###Noteonlogging:#Ifanyofdebugfile,logfileandlogfacilityaredefinedthenthey#willb
5、eused.Ifdebugfileand/orlogfilearenotdefinedand#logfacilityisdefinedthentherespectivelogginganddebug#messageswillbelogedtosyslog.Iflogfacilityisnotdefined#thendebugfileandlogfilewillbeusedtologmessges.If#logfacilityisnotdefinedanddebugfileand/orlogfilearenot#definedthendefaultswillbe
6、usedfordebugfileandlogfileas#requiredandmessageswillbesentthere.##Filetowritedebugmessagesto#debugfile/var/log/ha-debug###Filetowriteothermessagesto#logfile/var/log/ha-log日志文件存放位置###Facilitytouseforsyslog()/logger#logfacilitylocal0###Anoteonspecifying"howlong"timesbelow...##Thedefau
7、lttimeunitisseconds#10meanstenseconds##Youcanalsospecifytheminmilliseconds#1500msmeans1.5seconds###keepalive:howlongbetweenheartbeats?#keepalive2指明心跳時(shí)間為2秒##deadtime:howlong-to-declare-host-dead?##Ifyousetthistoolowyouwillgettheproblematic#split-brain(orclusterpartition)problem.#Seet
8、heFAQforhowtousewar