heartbeat 安裝配置


wKiom1bOYTfiSXBQAACBZYxx6NI565.png


1.服務器資源配置

wKioL1bOYsLgeJMxAAF-qBsp05g436.jpg

2.配置主機名

wKioL1bOYueSoEsRAAEAm_oqIt8174.jpg

3.配置hosts

Master和Backup配置相同,如下

cat >>/etc/hosts <<eof

192.168.37.7 data-1-1

192.168.37.8 data-1-2

10.0.10.7 data-1-1

10.0.10.8 data-1-2

eof

4.添加路由

Master主機:

/sbin/route add -host 10.0.10.8 dev eth2

echo'/sbin/route add -host 10.0.10.8 dev eth2' >> /etc/rc.local

Backup備機:

/sbin/route add -host 10.0.10.7 dev eth2

echo'/sbin/route add -host 10.0.10.7 dev eth2' >> /etc/rc.local

5.安裝軟件包

rpm-ivh epel-release-6-8.noarch.rpm

yuminstall heartbeat -y

cd /usr/share/doc/heartbeat-3.0.4

cp ha.cf ha.cf.`date +%Y%m%d-%H%M%S`

cpha.cf authkeys haresources /etc/ha.d

6.配置ha.cf文件

echo >ha.cf

cat >>ha.cf<<eof

#the start by xujh

debugfile /var/log/ha-debug

logfile /var/log/ha-log

logfacility local1

keepalive 2

deadtime 30

warntime 10

initdead 60

#bcast eth2

mcast eth2 225.0.0.181 694 1 0

auto_failback on

node data-1-1

node data-1-2

crm no

#the end by xujh

eof

7.配置haresource文件

echo >haresources

cat >> haresources <<eof

#the start by xujh

data-1-1 IPaddr::10.0.0.17/24/eth1

data-1-2 IPaddr::10.0.0.18/24/eth1

#the end by xujh

eof

8.配置authkeys文件

chmod 600 authkeys

echo > authkeys

cat >>authkeys <<eof

#the start by xujh

auth 1

1 sha147e9336850f1db6fa58bc470bc9b7810eb397f04

#the end by xujh

eof

9.啓停heartbeat服務

/etc/init.d/heartbeat start

/etc/init.d/heartbeatstop

10.查看服務

wKioL1bOZHrShN5mAAE5Zjn2X_Y517.jpg

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章