分类: LINUX
2009-12-22 14:05:58
rpm -ivh ipvsadm-1.24-5.i386.rpm
rpm -ivh heartbeat-pils-2.0.4-1.el4.i386.rpm
rpm -ivh heartbeat-stonith-2.0.4-1.el4.i386.rpm
rpm -ivh heartbeat-2.0.4-1.el4.i386.rpm
rpm -ivh perl-Parse-RecDescent-1.94-1.rh.el.um.1.noarch.rpm
rpm -ivh perl-Mail-IMAPClient-2.2.9-1.rh.el.um.1.noarch.rpm
rpm -ivh perl-Digest-SHA1-2.07-5.i386.rpm
rpm -ivh perl-Digest-HMAC-1.01-13.noarch.rpm
rpm -ivh perl-Net-DNS-0.48-1.i386.rpm
rpm -ivh perl-Authen-SASL-2.08-1.rh.el.um.1.noarch.rpm
rpm -ivh perl-Net-SSLeay-1.25-3.2.el4.rf.i386.rpm
rpm -ivh perl-IO-Socket-SSL-0.96-1.rh.el.um.1.noarch.rpm
rpm -e perl-LDAP
rpm -ivh perl-ldap-0.3202-1.rh.el.um.1.noarch.rpm
rpm -ivh perl-modules-5.8.5-3.i386.rpm
rpm -ivh --force perl-libnet-1.19-3.noarch.rpm ##(用force的原因:安装包中man3里有10个文件与包perl.5.8.5-16中的相同)
rpm -ivh heartbeat-ldirectord-2.0.4-1.el4.i386.rpm
导向服务器角色所需软件包安装完毕
所有软件包见附件
群集公共地址 vip=192.168.2.3
群集ha节点1(主): 主机名mxb6 eth0=192.168.2.6/24 eth1=192.168.3.6/24
群集ha节点2(备): 主机名mxb7 eth0=192.168.2.7/24 eth1=192.168.3.7/24
真实应用服务器1: eth0=192.168.2.20/24 lo:0=192.168.2.5/32
真实应用服务器2: eth0=192.168.2.21/24 lo:0=192.168.2.5/32
ha配置文件样例在/usr/share/doc/heartbeat-2.0.4目录里
将文件ha.cf,haresource,authkey文件复制到 /etc/ha.d/
ldirectord样例文件在/usr/share/doc/heartbeat-ldirectord-2.0.4目录
将ldirectord.cf复制到/etc/ha.d/
然后按下面的内容进行配置.
127.0.0.1 localhost.localdomain localhost
192.168.2.6 mxb6
192.168.2.7 mxb7
192.168.2.20 mxb20
192.168.2.21 mxb21
192.168.2.22 mxb22
192.168.2.3 vip
执行命令:
chkconfig --del ldirectord
chkconfig --level 2345 heartbeat on
logfile /var/log/ha-log
logfacility local0
keepalive 2
deadtime 30
warntime 10
initdead 120
udpport 694
#baud 19200
#serial /dev/ttyS0
bcast eth1
ucast eth1 192.168.3.7 #另一个节点的
auto_failback on
node mxb6
node mxb7
ping 192.168.2.1
chmod 600 /etc/ha.d/authkeys
编辑内容为:
auth 1
1 crc
#2 sha1 HI!
#3 md5 Hello!
mxb6 IPaddr::192.168.2.3/24/eth0/192.168.2.255 ldirectord::ldirectord.cf LVSSyncDaemonSwap::master
# Global Directives
checktimeout=1
checkinterval=1
#fallback=127.0.0.1:80
autoreload=yes
logfile="/var/log/ldirectord.log"
#logfile="local0"
quiescent=yes
# A sample virual with a fallback that will override the gobal setting
virtual=192.168.2.3:80
real=192.168.2.20:80 gate w 5
real=192.168.2.21:80 gate w 5
real=192.168.2.22:80 gate w 5
# fallback=127.0.0.1:80 gate
service=http
checkport=80
request="index.html"
receive="Test Page"
# virtualhost=rs.net
scheduler=rr
#persistent=600
#netmask=255.255.255.255
protocol=tcp
NETWORKING=yes
HOSTNAME=mxb6
net.ipv4.ip_forward = 0
执行命令:
chkconfig --del ldirectord
chkconfig --level 2345 heartbeat on
logfile /var/log/ha-log
logfacility local0
keepalive 2
deadtime 30
warntime 10
initdead 120
udpport 694
#baud 19200
#serial /dev/ttyS0
bcast eth1
ucast eth1 192.168.3.6 #另一个节点的
auto_failback on
node mxb6
node mxb7
ping 192.168.2.1
chmod 600 /etc/ha.d/authkeys
编辑内容为:
auth 1
1 crc
#2 sha1 HI!
#3 md5 Hello!
mxb6 IPaddr::192.168.2.3/24/eth0/192.168.2.255 ldirectord::ldirectord.cf LVSSyncDaemonSwap::master
# Global Directives
checktimeout=1
checkinterval=1
#fallback=127.0.0.1:80
autoreload=yes
logfile="/var/log/ldirectord.log"
#logfile="local0"
quiescent=yes
# A sample virual with a fallback that will override the gobal setting
virtual=192.168.2.3:80
real=192.168.2.20:80 gate w 5
real=192.168.2.21:80 gate w 5
real=192.168.2.22:80 gate w 5
# fallback=127.0.0.1:80 gate
service=http
checkport=80
request="index.html"
receive="Test Page"
# virtualhost=rs.net
scheduler=rr
#persistent=600
#netmask=255.255.255.255
protocol=tcp
NETWORKING=yes
HOSTNAME=mxb6
net.ipv4.ip_forward = 0
net.ipv4.conf.lo.arp_ignore = 1
net.ipv4.conf.lo.arp_announce = 2
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2
DEVICE=lo:0
IPADDR=192.168.2.3
NETMASK=255.255.255.255
NETWORK=192.168.2.3
ONBOOT=yes
ARP=no
新建index.html文件,内容为"Test Page",能够通过 访问
chinaunix网友2010-10-21 21:52:40
heartbeat 所需的那些rpm包,有么?给发一份吧,尤其是perl相关的rpm,邮箱:zhang.rrqq@163.com