标签:des style blog http io ar color os 使用
先查询一下当前系统的版本号信息:uname -a
ls /usr/src/linux
#!/bin/bash # description: start LVS of DirectorServer # website director vip. SNS_VIP=192.168.2.138 SNS_RIP1=192.168.2.137 #SNS_RIP2=61.164.122.10 . /etc/rc.d/init.d/functions logger $0 called with $1 case "$1" in start) /sbin/ipvsadm --set 30 5 60 /sbin/ifconfig eth0:0 $SNS_VIP broadcast $SNS_VIP netmask 255.255.255.255 broadcast $SNS_VIP up /sbin/route add -host $SNS_VIP dev eth0:0 /sbin/ipvsadm -A -t $SNS_VIP:80 -s wrr -p 3 /sbin/ipvsadm -a -t $SNS_VIP:80 -r $SNS_RIP1:80 -g -w 1 #/sbin/ipvsadm -a -t $SNS_VIP:80 -r $SNS_RIP2:80 -g -w 1 touch /var/lock/subsys/ipvsadm >/dev/null 2>&1 ;; stop) /sbin/ipvsadm -C /sbin/ipvsadm -Z ifconfig eth0:0 down route del $SNS_VIP rm -rf /var/lock/subsys/ipvsadm >/dev/null 2>&1 echo "ipvsadm stoped" ;; status) if [ ! -e /var/lock/subsys/ipvsadm ];then echo "ipvsadm stoped" exit 1 else echo "ipvsadm OK" fi ;; *) echo "Usage: $0 {start|stop|status}" exit 1 esac exit 0
启动:
sh lvs-dr.sh start
标签:des style blog http io ar color os 使用
原文地址:http://www.cnblogs.com/super-d2/p/4134754.html