新聞中心
這里我就提供幾個(gè)主要軟件包了,其他的一些根據(jù)錯(cuò)誤提示安裝或提前安裝完畢。
十多年的襄州網(wǎng)站建設(shè)經(jīng)驗(yàn),針對(duì)設(shè)計(jì)、前端、開發(fā)、售后、文案、推廣等六對(duì)一服務(wù),響應(yīng)快,48小時(shí)及時(shí)工作處理。營銷型網(wǎng)站建設(shè)的優(yōu)勢是能夠根據(jù)用戶設(shè)備顯示端的尺寸不同,自動(dòng)調(diào)整襄州建站的顯示方式,使網(wǎng)站能夠適用不同顯示終端,在瀏覽器中調(diào)整網(wǎng)站的寬度,無論在任何一種瀏覽器上瀏覽網(wǎng)站,都能展現(xiàn)優(yōu)雅布局與設(shè)計(jì),從而大程度地提升瀏覽體驗(yàn)。創(chuàng)新互聯(lián)從事“襄州網(wǎng)站設(shè)計(jì)”,“襄州網(wǎng)站推廣”以來,每個(gè)客戶項(xiàng)目都認(rèn)真落實(shí)執(zhí)行。
http://pan.baidu.com/share/link?shareid=2762183074&uk=1210957557
http://pan.baidu.com/share/link?shareid=2768037872&uk=1210957557
http://pan.baidu.com/share/link?shareid=2769389056&uk=1210957557
node1(主服務(wù)器):eth0:192.168.1.168(node1) eth2:192.168.1.183(priv1)
node2(從服務(wù)器):eth0:192.168.1.181(node2) eth2:192.168.1.182(priv2)
VIP地址:192.168.1.185(只需在heartbeat配置文件里寫上即可)
node1和node2所有操作一樣
[root@node1~]# vi /etc/hosts
192.168.1.168 node1
192.168.1.181 node2
192.168.1.183 priv1
192.168.1.182 priv2
[root@node1~]#groupadd -g 65 haclient
[root@node1~]#useradd -u 501 -g haclienthacluster
[root@node1~]#tar jxf /samba/Reusable-Cluster-Components-glue--glue-1.0.9.tar.bz2 -C /usr/local/src/
[root@node1~]#cd /usr/local/src/Reusable-Cluster-Components-glue--glue-1.0.9/
[root@node1Reusable-Cluster-Components-glue--glue-1.0.9]#./autogen.sh
[root@node1Reusable-Cluster-Components-glue--glue-1.0.9]#./configure --prefix=/usr/local/ha/
[root@node1Reusable-Cluster-Components-glue--glue-1.0.9]#make
[root@node1Reusable-Cluster-Components-glue--glue-1.0.9]#make install
[root@node1Reusable-Cluster-Components-glue--glue-1.0.9]#tar jxf /samba/Cluster-Resource-Agents-5ae70412eec8.tar.bz2 -C ./
[root@node1Reusable-Cluster-Components-glue--glue-1.0.9]#cd /usr/local/src/Cluster-Resource-Agents-5ae70412eec8/
[root@node1Cluster-Resource-Agents-5ae70412eec8]#./autogen.sh
[root@node1Cluster-Resource-Agents-5ae70412eec8]#./configure --prefix=/usr/local/ha/
[root@node1Cluster-Resource-Agents-5ae70412eec8]#make
[root@node1Cluster-Resource-Agents-5ae70412eec8]#make install
[root@node1Cluster-Resource-Agents-5ae70412eec8]#cd ..
[root@node1src]#tar jxf /samba/Heartbeat-3-0-STABLE-3.0.4.tar.bz2 -C ./
[root@node1src]#cd Heartbeat-3-0-STABLE-3.0.4/
[root@node1Heartbeat-3-0-STABLE-3.0.4]# ./bootstrap
[root@node1Heartbeat-3-0-STABLE-3.0.4]#./configure --prefix=/usr/local/ha/
[root@node1Heartbeat-3-0-STABLE-3.0.4]#gmake
[root@node1Heartbeat-3-0-STABLE-3.0.4]#make install
[root@node1Heartbeat-3-0-STABLE-3.0.4]#chkconfig --add heartbeat
[root@node1Heartbeat-3-0-STABLE-3.0.4]#cp /usr/local/ha/share/doc/heartbeat/haresources /usr/local/ha/etc/ha.d/
[root@node1Heartbeat-3-0-STABLE-3.0.4]#cp /usr/local/ha/share/doc/heartbeat/authkeys /usr/local/ha/etc/ha.d/
[root@node1Heartbeat-3-0-STABLE-3.0.4]#cp /usr/local/ha/share/doc/heartbeat/ha.cf /usr/local/ha/etc/ha.d/
[root@node1Heartbeat-3-0-STABLE-3.0.4]#chmod 600 /usr/local/ha/etc/ha.d/authkeys
[root@node1Heartbeat-3-0-STABLE-3.0.4]#cd /usr/local/ha/etc/ha.d/
[root@node1ha.d]#vi authkeys //我選擇的是第一種驗(yàn)證模式
[root@node1ha.d]#vi ha.cf
#去掉以***釋
debugfile /var/log/ha-debug //debug消息存放路徑
logfile /var/log/ha-log //heartbeat日志存放路徑
keepalive 2 //指定心跳時(shí)間間隔是2秒
deadtime 30 //指定奮勇借點(diǎn)在30秒內(nèi)沒有收到主節(jié)點(diǎn)的心跳信號(hào)后,則立即接管主節(jié)點(diǎn)的服務(wù)資源
warntime 10 //指定心跳延遲時(shí)間為10秒,當(dāng)10秒鐘內(nèi)備份節(jié)點(diǎn)收取不到主節(jié)點(diǎn)的心跳信號(hào)時(shí),就會(huì)讓日志中寫入一個(gè)警告信息,但此時(shí)不會(huì)切換服務(wù)
initdead 120 //在某些配置上,系統(tǒng)啟動(dòng)或重啟之后需要經(jīng)過一段時(shí)間網(wǎng)絡(luò)才能正常工作,該選項(xiàng)用于解決這種情況產(chǎn)生的時(shí)間間隔,取值至少為deadtime的兩倍
udp port 694 //設(shè)置廣播通信使用的端口,默認(rèn)為694
baud 19200 //設(shè)置串行通信的波特率
bcast eth2 //表示在eth2接口上使用以太網(wǎng)廣播方式
auto_failback on //用來定義當(dāng)主節(jié)點(diǎn)恢復(fù)后,是否將服務(wù)自動(dòng)切回,heartbeat的兩臺(tái)主機(jī)分別為主節(jié)點(diǎn)和備份節(jié)點(diǎn)。主節(jié)點(diǎn)在正常情況下占用資源并運(yùn)行所有的服務(wù),遇到故障時(shí)把資源交給備份節(jié)點(diǎn)并由備份節(jié)點(diǎn)運(yùn)行服務(wù)。在該選項(xiàng)設(shè)為on的情況下,一旦主節(jié)點(diǎn)恢復(fù)運(yùn)行,則自動(dòng)獲取資源并取代備份節(jié)點(diǎn),如果該選項(xiàng)設(shè)置為off,那么當(dāng)主節(jié)點(diǎn)恢復(fù)后,將變?yōu)閭浞莨?jié)點(diǎn),而原來的備份節(jié)點(diǎn)成為主節(jié)點(diǎn)
node node1 //主節(jié)點(diǎn)主機(jī)名
node node2 //備用節(jié)點(diǎn)主機(jī)名
ping 192.168.1.1 //選擇ping的節(jié)點(diǎn),ping節(jié)點(diǎn)選擇的越好,則HA集群就更強(qiáng)壯
ping_group group1 192.168.1.100 192.168.1.150 //類似于ping
apiauthpingdgid=haclientuid=hacluster
[root@node1ha.d]#vi haresources
node1 IPaddr::192.168.1.185 httpd //node1為主節(jié)點(diǎn)主機(jī)名 ,IPaddr為heartbeat自帶的一個(gè)執(zhí)行腳本,192.168.1.185為VIP地址,httpd表示啟動(dòng)httpd服務(wù)
node1做完后繼續(xù)做node2,配置是一樣的,我就不重復(fù)說明了,都安裝配置完畢后再node1上ifconfig看看是否有VIP地址了
node1和node2都已經(jīng)配置好了apache服務(wù),現(xiàn)在用VIP地址訪問就可以訪問node1上的apache網(wǎng)站,node1如宕機(jī)了,node2會(huì)在指定的時(shí)候替代上去,那時(shí)訪問的就是node2上apache網(wǎng)站
分享標(biāo)題:heartbeat安裝
標(biāo)題鏈接:http://ef60e0e.cn/article/jdoooj.html