資源描述:
《linux下自帶雙機服務heartbeat的配置》由會員上傳分享,免費在線閱讀,更多相關內(nèi)容在行業(yè)資料-天天文庫。
1、linux下自帶雙機服務heartbeat的配置首先要安裝heartbeat服務所需要的補丁包,如果在你的linux系統(tǒng)下可以連接到外網(wǎng),那么就可以使用云安裝的形式其命令如下:yuminstallheartbeat-*這樣的安裝方法雖然簡單但是會把一些不必要的補丁全部安裝,要求必須可以連接到外網(wǎng),還有一種方法就是先把heartbeat所需的補丁包全部下載到移動設備,再傳送到需要安裝的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以上這幾個包就是heartbeat服務所需要的補丁包,安裝順序也必須相同如有安裝不上的包重復安裝幾次即可。其次在安裝完所有的heartbeat補丁包后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指明心跳時間為2秒##deadtime:howlong-to-declare-host-dead?##Ifyousetthistoolowyouwillgettheproblematic#split-brain(orclusterpartition)problem.#Seet
8、heFAQforhowtousewar