2011-04-06 17:15:01| 分类: Linux Cluster | 标签: |举报 |字号大中小 订阅
8602_real(192.168.2.119/110/119)
[root@LVS-master resource.d] cat /usr/local/bin/realserver.sh
8601_real (192.168.2.124/125/126/104/105/106/27)
[root@localhost ~]# cat /usr/local/bin/realserver.sh
ifconfig lo:0 192.168.2.253 netmask 255.255.255.255 broadcast 192.168.2.253 up
route add -host 192.168.2.253 dev lo:0
echo "1" > /proc/sys/net/ipv4/conf/lo/arp_ignore
echo "2" > /proc/sys/net/ipv4/conf/lo/arp_announce
echo "1" > /proc/sys/net/ipv4/conf/all/arp_ignore
echo "2" > /proc/sys/net/ipv4/conf/all/arp_announce
调度器
[root@LVS-master resource.d] cat /etc/ha.d/ldirectord.cf
# Global Directives
checktimeout=4
checkinterval=2
#fallback=127.0.0.1:80
autoreload=yes
logfile="/var/log/ldirectord.log"
#logfile="local0"
#emailalert="admin@x.y.z"
#emailalertfreq=3600
#emailalertstatus=all
#quiescent=yes
quiescent=no
# Sample for an http virtual service
#SH_level2
virtual=192.168.2.253:8601
real=192.168.2.125:8601 gate 2
real=192.168.2.126:8601 gate 2
real=192.168.2.27:8601 gate 1
real=192.168.2.104:8601 gate 3
real=192.168.2.124:8601 gate 4
real=192.168.2.105:8601 gate 3
real=192.168.2.106:8601 gate 2
scheduler=wlc
service=none
checktype=connect
protocol=tcp
checkport=8601
#SHZ_level2
virtual=192.168.2.252:8601
real=192.168.2.110:8601 gate
real=192.168.2.109:8601 gate
real=192.168.2.119:8601 gate
scheduler=wlc
checktype=connect
protocol=tcp
checkport=8601
[root@LVS-master resource.d] vi /etc/ha.d/haresources
LVS-master \
ldirectord::ldirectord.cf \
tunip
(注:uname -n = LVS-master )
[root@LVS-master resource.d]# cat /etc/ha.d/resource.d/tunip
#/bin/sh
#/sbin/ifconfig tunl0 192.168.2.253 broadcast 192.168.2.253 netmask 255.255.255.255 up
#
# description: Start DirectorServer of LVS
# chkconfig: - 08 92
#
# Start LVS DR in Directorserver
VIP=192.168.2.253
VIP8602=192.168.2.252
/etc/rc.d/init.d/functions
case "$1" in
start)
echo " Start LVS of DirectorServer"
# set the Virtual IP Address
/sbin/modprobe ipip
# /sbin/ifconfig tunl0 $VIP broadcast $VIP netmask 255.255.255.255 up
/sbin/ifconfig lo:0 $VIP broadcast $VIP netmask 255.255.255.255 up
/sbin/ifconfig lo:1 $VIP8602 broadcast $VIP8602 netmask 255.255.255.255 up
;;
stop)
echo "Close LVS Directorserver"
#/sbin/modprobe -r ipip
#/sbin/ifconfig tunl0 down
/sbin/ifconfig lo:0 down
/sbin/ifconfig lo:1 down
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
评论