您好,登錄后才能下訂單哦!
這篇文章主要介紹“heartbeat3.0.4的安裝配置方法”,在日常操作中,相信很多人在heartbeat3.0.4的安裝配置方法問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”heartbeat3.0.4的安裝配置方法”的疑惑有所幫助!接下來,請跟著小編一起來學(xué)習(xí)吧!
(一) 環(huán)境說明
操作系統(tǒng):centos 5.4 x86_64
節(jié)點(diǎn)1:
主機(jī)名:aos
Ip:xxxxx.82
節(jié)點(diǎn)2:
主機(jī)名:weibo
Ip:xxxx.82
注意:2個節(jié)點(diǎn)都要在各自的hosts文件中指定節(jié)點(diǎn)主機(jī)名和ip的對應(yīng)關(guān)系,在ha.cf中node參數(shù)指定的主機(jī)名要和uname –a,host文件里指定的相同
(二) heartbeat3.0組成
heartbeat3.0版本有三部分組成:Heartbeat、Cluster Glue、Resource Agents
1、hearbeat本身是整個集群的基礎(chǔ)(cluster messaging layer),負(fù)責(zé)維護(hù)集群各節(jié)點(diǎn)的信息以及它們之前通信; |
(三) 創(chuàng)建用戶和組
[root@aos ha.d]# groupadd haclient
[root@aos ha.d]# useradd hacluster -g haclient -s /sbin/nologin
(四) 安裝 ? 安裝Cluster-Glue
#tar jvxf Reusable-Cluster-Components-glue--glue-1.0.7.tar.bz2
#cd Reusable-Cluster-Components-glue--glue-1.0.7
#./autogen.sh
#./configure --prefix=/usr/local/ha_soft
#make
#make install
? 安裝resource-agent
#cd ..
#tar zvxf ClusterLabs-resource-agents-agents-1.0.4-0-gc06b6f3.tar.gz
#cd ClusterLabs-resource-agents-c06b6f3/
#./autogen.sh
#./configure --prefix=/usr/local/ha_soft CFLAGS=-I/usr/local/ha_soft/include LDFLAGS=-L/usr/local/ha_soft/lib
#cp /usr/local/ha_soft/include/heartbeat/glue_config.h /usr/local/ha_soft/include/heartbeat/glue_config.h.bak
#vi /usr/local/ha_soft/include/heartbeat/glue_config.h(找到如下幾個設(shè)置項刪除對應(yīng)的行)
HA_SYSCONFDIR
HA_HBCONF_DIR
HA_HBCONF_DIR
#make
#vim /etc/ld.so.conf.d/heartbeat.conf(輸入如下行)
/usr/local/ha_soft/lib
#ldconfig
#make install
? 安裝heartbeat
#cd ..
#tar jvxf Heartbeat-3-0-STABLE-3.0.4.tar.bz2
#cd Heartbeat-3-0-STABLE-3.0.4
# ./bootstrap
#./configure --prefix=/usr/local/ha_soft CFLAGS=-I/usr/local/ha_soft/include LDFLAGS=-L/usr/local/ha_soft/lib
#cp /srv/Heartbeat-3-0-STABLE-3.0.4/lib/plugins/HBcomm/hbaping.c /srv/Heartbeat-3-0-STABLE-3.0.4/lib/plugins/HBcomm/hbaping.c.bak
# vim /srv/Heartbeat-3-0-STABLE-3.0.4/lib/plugins/HBcomm/hbaping.c(安裝源碼目錄,刪除326行)
#make
#make install
(五) 配置(節(jié)點(diǎn)1和節(jié)點(diǎn)2相同,區(qū)別就是檢查ip是對方) ? 從源碼編譯目錄中復(fù)制配置文件到安裝目錄
復(fù)制附件<配置文件>里的配置文件到 /usr/local/ha_soft/etc/ha.d/
? 編輯ha.cf 主配置文件
[root@aos ha.d]# cd /usr/local/ha_soft/etc/ha.d
[root@aos ha.d]# vim ha.cf
#debugfile /var/log/ha-debug
#logfile /var/log/ha-log
logfacility local0
keepalive 2
deadtime 6
warntime 4
initdead 30
udpport 694
ucast eth2 192.168.1.200
auto_failback off
node aos
node weibo
compression bz2
compression_threshold 2
ping_group group1 xxxxx82 xxxx.80
respawn root /usr/local/ha_soft/lib/heartbeat/ipfail
apiauth ipfail gid=root uid=root
debug 0
? 編輯authkeys 驗證信息文件
[root@aos ha.d]# cd /usr/local/ha_soft/etc/ha.d
[root@aos ha.d]# vim authkeys
auth 1
1 crc
[root@aos ha.d]# chmod 600 authkeys
? 編輯haresources 資源控制配置文件
[root@aos ha.d]# cd /usr/local/ha_soft/etc/ha.d
[root@aos ha.d]# vim haresources
aos IPaddr::xxxxx.70/25/eht0/xxxxx.127
? 鏈接文件
[root@aos heartbeat]# vim /etc/ld.so.conf(加入到文件末尾)
/usr/local/ha_soft/lib/
[root@aos heartbeat]# ldconfig
#cp /usr/local/ha_soft/etc/ha.d/resource.d/hto-mapfuncs /usr/local/ha_soft/etc/ha.d/resource.d/hto-mapfuncs.bak
[root@aos heartbeat]# vim +35 /usr/local/ha_soft/etc/ha.d/resource.d/hto-mapfuncs(注釋35行)
(六) 注冊并且啟動服務(wù)
[root@aos ha.d]# chkconfig --add heartbeat
[root@aos ha.d]# chkconfig levles 2345 heartbeat on
[root@aos ha.d]# /etc/init.d/heartbeat start
到此,關(guān)于“heartbeat3.0.4的安裝配置方法”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識,請繼續(xù)關(guān)注億速云網(wǎng)站,小編會繼續(xù)努力為大家?guī)砀鄬嵱玫奈恼拢?/p>
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。