登录  
 加关注
查看详情
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

herb

喜欢写博,喜欢安静,喜欢挑战!

 
 
 

日志

 
 

LVS ipvsadm+heartbeat+ldirecrtord(DR)示例  

2011-04-06 17:15:01|  分类: Linux Cluster |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

8602_real(192.168.2.119/110/119)

[root@LVS-master resource.d] cat /usr/local/bin/realserver.sh

ifconfig lo:0 192.168.2.252 netmask 255.255.255.255 broadcast 192.168.2.252 up
route add -host 192.168.2.252 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

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

  评论这张
 
阅读(911)| 评论(0)

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018