redhatAS4.2 安装集群LVS
2008-11-26 11:00:32 来源:WEB开发网Director server 端脚本文件
[root@ns ~]# more /etc/init.d/tunlvs
#!/bin/sh
# description: start LVS of Directorserver
VIP=192.168.0.100
RIP1=192.168.0.127
RIP2=192.168.0.128
#RIPn=192.168.0.n
GW=192.168.0.1
. /etc/rc.d/init.d/functions
case "$1" in
start)
echo " start LVS of DirectorServer"
# set the Virtual IP Address
/sbin/ifconfig tunl0 $VIP broadcast $VIP netmask 255.255.255.255 up
/sbin/route add -host $VIP dev tunl0
#Clear IPVS table
/sbin/ipvsadm -C
#set LVS
/sbin/ipvsadm -A -t $VIP:80 -s rr
/sbin/ipvsadm -a -t $VIP:80 -r $RIP1:80 -i
/sbin/ipvsadm -a -t $VIP:80 -r $RIP2:80 -i
#/sbin/ipvsadm -a -t $VIP:80 -r $RIP3:80 -i
#Run LVS
/sbin/ipvsadm
#end
;;
stop)
echo "close LVS Directorserver"
ifconfig tunl0 down
/sbin/ipvsadm -C
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
realserver端同样使用上面的配置文件就可以。
2、安装heartbeat
libnet.tar 下载地址:http://www.packetfactory.net/libnet/ 稳定版本是:1.1.2.1
e2fsprogs 可以用rpm 安装光盘
heartbeat-2.0.2.tar.gz 下载地址: http://www.linux-ha.org/download/
更多精彩
赞助商链接