|
一 先安装lvs corosync软件
二 安装ldirectord
先配制好yum源,然后安装
1.yum -y --nogpgcheck localinstall perl-MailTools-1.77-1.el5.noarch.rpm heartbeat-ldirectord-2.1.4-9.el5.i386.rpm
2.cp /usr/share/doc/heartbeat-ldirectord-2.1.4/ldirectord.cf/etc/ha.d
3.cd/etc/ha.d
三 修改node1和node2的配置文件,两个步骤一样
chechout=5
timeout=5checkinterval=1
autoreload=yes
logfile="/var/log/ldirectord.log"
quietscent=yes
virtual=172.16.15100:80
real=172.16.15.70:80 gate
real=172.16.15.60:80 gate
fallback=127.0.0.1:80 gate
service=http
request=".test.html"
receive="ok"
scheduler=rr
protoclo=tcp
checktype=negotiate
checkport=80
scp -p ldirectord.cf node2:/etc/ha.d
然后分别在RS1和RS2的/var/www/html建立.test.html文件,内容为haha
echo "haha">/var/www/html/.test.html
记住别让他开机自动启动 chkconfig ldirectord off
接下来配置corosync
crm
configure
primitive vip ocf:heartbeat:IPaddr params ip=172.16.5.100
primitive ipvsadm lsb:ipvsadm
commit
|
|
|