RT,我用3台机子+Piranha做群集没问题,但是用2台机做群集,也就是一台做Director和RealServer就不行了,求高人提供解决方法
wwlahtc
周三, 2012-06-20 15:51
Permalink
我也一样有此需求,内部测试可以正常访问Realserver的测试web页面。可到生产环境中,上线不到20分钟 我前端防火墙CPU就冲高到60%,用测试脚本访问VIP,发现总是延时在3~5s,页面访问很慢。寻明白人指点迷津,我的配置如下: ######keeplived配置 ! Configuration File for keepalived global_defs { router_id LVS_MASTER }
vrrp_sync_group VG1 { group { VI_1 } } vrrp_instance VI_1 { state MASTER interface bond0 lvs_sync_daemon_inteface bond0 virtual_router_id 51 priority 100 advert_int 1 authentication { auth_type PASS auth_pass 2111 } virtual_ipaddress { 10.10.1.35 10.10.1.36 } } virtual_server 10.10.1.35 80 { delay_loop 5 #5秒检测一次realserver lb_algo wrr #负载均衡算法 wrr lb_kind DR nat_mask 255.255.255.0 persistence_timeout 50 #(同一IP的连接,在该秒内被分配到同一台realserver) protocol TCP
real_server 10.10.1.31 80 { weight 10 TCP_CHECK { connect_timeout 10 nb_get_retry 3 connect_port 80 } } real_server 10.10.1.32 80 { weight 10 TCP_CHECK { connect_timeout 10 nb_get_retry 3 connect_port 80 } } }
virtual_server 10.10.1.36 80 { delay_loop 5 lb_algo wrr lb_kind DR nat_mask 255.255.255.0 persistence_timeout 50 protocol TCP
real_server 10.10.1.31 80 { weight 10 TCP_CHECK { connect_timeout 10 nb_get_retry 3 connect_port 80 } } real_server 10.10.1.32 80 { weight 10 TCP_CHECK { connect_timeout 10 nb_get_retry 3 connect_port 80 } } } ############同时在两台服务器上运行realserver.sh #!/bin/bash SNS_VIP='10.10.1.35 10.10.1.36' . /etc/rc.d/init.d/functions case "$1" in start) NUM=1 for VIP in $SNS_VIP do ifconfig lo:$NUM $VIP netmask 255.255.255.255 broadcast $IP NUM=`expr $NUM + 1` done
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 echo "1" > /proc/sys/net/ipv4/ip_forward sysctl -p >/dev/null 2>&1 echo "RealServer Start OK" ;; stop) NUM=1 for VIP in $SNS_VIP do ifconfig lo:$NUM $VIP down NUM=`expr $NUM + 1` done
echo "0" >/proc/sys/net/ipv4/conf/lo/arp_ignore echo "0" >/proc/sys/net/ipv4/conf/lo/arp_announce echo "0" >/proc/sys/net/ipv4/conf/all/arp_ignore echo "0" >/proc/sys/net/ipv4/conf/all/arp_announce echo "0" > /proc/sys/net/ipv4/ip_forward echo "RealServer Stoped" ;; *) echo "Usage: $0 {start|stop}" exit 1 esac exit 0
Anonymous (没有被验证)
周五, 2013-09-20 00:54
This forum needed shkanig up and you've just done that. Great post!
周一, 2013-09-23 03:21
We need a lot more inhstigs like this!
周三, 2014-03-05 12:03
Now I'm like, well duh! Truly thaunfkl for your help.
周三, 2014-03-05 19:34
That's a posting full of intgshi!
周五, 2014-05-09 19:00
click here quote auto insurance onlinecarinsurancefreequotes.com auto insursance quotes generic viagra
周一, 2014-05-26 10:02
mobile buylevitraonlinejq.com temporary impotence average car insurance rates
周日, 2014-11-09 10:06
car insurance policy distance learning computer buy generic cialis viagra sale viagra for women
周六, 2013-11-09 12:23
insurance auto quote
周五, 2013-11-29 22:31
My Home Insurance Place, Around the house - Child-oriented Home cheap health insurance
周五, 2013-12-06 03:01
car insurance usa ohio car insurance quotes auto insurance quotes carinsurancequotes insurance auto ireland insurance breakdown auto
周四, 2013-12-19 14:12
auto insurance quotes free auto insurance levitra online pharmacy cialis vs levitra car insurence
周日, 2014-01-05 06:53
mobile click here sildenafil www.allhealthinsurers.net insureyourcaronline.com
周日, 2014-01-19 21:56
cialis stock options buy generic levitra 10mg trading platform forex very very cheap flights
周一, 2012-08-20 13:29
192.168.1.1/24 dev eth1 label eth1:1
周二, 2014-01-14 03:32
biosyjw payday loans xnTxN payday loans xQIiV payday loans oSXIo
周二, 2014-01-28 18:21
nmnkbeyz paydayloansusaprd.com vmAtn payday loans 9038 quick payday loans 5806
周一, 2014-02-10 02:06
utszbkv payday loans >:]] payday loans %-[[[ quickquid 5515
周二, 2014-03-18 04:11
bvrfmfd
周三, 2014-03-19 15:52
idzxofp rikxfn
周三, 2014-07-02 17:17
pdlwzz magnum cash advance 1699 instant loan today ROIjlL online loans same day nLKQpn instant cash loans %-[[[
周三, 2014-08-20 16:49
ltwkod
There are currently 0 users online.
wwlahtc
周三, 2012-06-20 15:51
Permalink
2台 Centos6.2 服务器 配置VS/DR+keepalived【既做转发有做realserver】问题
我也一样有此需求,内部测试可以正常访问Realserver的测试web页面。可到生产环境中,上线不到20分钟 我前端防火墙CPU就冲高到60%,用测试脚本访问VIP,发现总是延时在3~5s,页面访问很慢。寻明白人指点迷津,我的配置如下:
######keeplived配置
! Configuration File for keepalived
global_defs {
router_id LVS_MASTER
}
vrrp_sync_group VG1 {
group {
VI_1
}
}
vrrp_instance VI_1 {
state MASTER
interface bond0
lvs_sync_daemon_inteface bond0
virtual_router_id 51
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 2111
}
virtual_ipaddress {
10.10.1.35
10.10.1.36
}
}
virtual_server 10.10.1.35 80 {
delay_loop 5 #5秒检测一次realserver
lb_algo wrr #负载均衡算法 wrr
lb_kind DR
nat_mask 255.255.255.0
persistence_timeout 50 #(同一IP的连接,在该秒内被分配到同一台realserver)
protocol TCP
real_server 10.10.1.31 80 {
weight 10
TCP_CHECK {
connect_timeout 10
nb_get_retry 3
connect_port 80
}
}
real_server 10.10.1.32 80 {
weight 10
TCP_CHECK {
connect_timeout 10
nb_get_retry 3
connect_port 80
}
}
}
virtual_server 10.10.1.36 80 {
delay_loop 5
lb_algo wrr
lb_kind DR
nat_mask 255.255.255.0
persistence_timeout 50
protocol TCP
real_server 10.10.1.31 80 {
weight 10
TCP_CHECK {
connect_timeout 10
nb_get_retry 3
connect_port 80
}
}
real_server 10.10.1.32 80 {
weight 10
TCP_CHECK {
connect_timeout 10
nb_get_retry 3
connect_port 80
}
}
}
############同时在两台服务器上运行realserver.sh
#!/bin/bash
SNS_VIP='10.10.1.35 10.10.1.36'
. /etc/rc.d/init.d/functions
case "$1" in
start)
NUM=1
for VIP in $SNS_VIP
do
ifconfig lo:$NUM $VIP netmask 255.255.255.255 broadcast $IP
NUM=`expr $NUM + 1`
done
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
echo "1" > /proc/sys/net/ipv4/ip_forward
sysctl -p >/dev/null 2>&1
echo "RealServer Start OK"
;;
stop)
NUM=1
for VIP in $SNS_VIP
do
ifconfig lo:$NUM $VIP down
NUM=`expr $NUM + 1`
done
echo "0" >/proc/sys/net/ipv4/conf/lo/arp_ignore
echo "0" >/proc/sys/net/ipv4/conf/lo/arp_announce
echo "0" >/proc/sys/net/ipv4/conf/all/arp_ignore
echo "0" >/proc/sys/net/ipv4/conf/all/arp_announce
echo "0" > /proc/sys/net/ipv4/ip_forward
echo "RealServer Stoped"
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
exit 0
Anonymous (没有被验证)
周五, 2013-09-20 00:54
Permalink
QGfGcVYuER
This forum needed shkanig up and you've just done that. Great post!
Anonymous (没有被验证)
周一, 2013-09-23 03:21
Permalink
rwGNGLupmrAJLgUXzcxy
We need a lot more inhstigs like this!
Anonymous (没有被验证)
周三, 2014-03-05 12:03
Permalink
bMWmQDqpWFdTDwrFp
Now I'm like, well duh! Truly thaunfkl for your help.
Anonymous (没有被验证)
周三, 2014-03-05 19:34
Permalink
AIpsXAMJzL
That's a posting full of intgshi!
Anonymous (没有被验证)
周五, 2014-05-09 19:00
Permalink
egcOoVfKCJWC
click here quote auto insurance onlinecarinsurancefreequotes.com auto insursance quotes generic viagra
Anonymous (没有被验证)
周一, 2014-05-26 10:02
Permalink
PwbLRZMEzaLo
mobile buylevitraonlinejq.com temporary impotence average car insurance rates
Anonymous (没有被验证)
周日, 2014-11-09 10:06
Permalink
ZOORUVJNLwh
car insurance policy distance learning computer buy generic cialis viagra sale viagra for women
Anonymous (没有被验证)
周六, 2013-11-09 12:23
Permalink
xgUYbEutSBkrMHZHnpm
insurance auto quote
Anonymous (没有被验证)
周五, 2013-11-29 22:31
Permalink
cZcbOxecDFTSPmKiC
My Home Insurance Place, Around the house - Child-oriented Home cheap health insurance
Anonymous (没有被验证)
周五, 2013-12-06 03:01
Permalink
ODFDbsyDCroQgfpRMp
car insurance usa ohio car insurance quotes auto insurance quotes carinsurancequotes insurance auto ireland insurance breakdown auto
Anonymous (没有被验证)
周四, 2013-12-19 14:12
Permalink
SsymJKIwPdit
auto insurance quotes free auto insurance levitra online pharmacy cialis vs levitra car insurence
Anonymous (没有被验证)
周日, 2014-01-05 06:53
Permalink
uoCGjjGmhfgurGbgDOb
mobile click here sildenafil www.allhealthinsurers.net insureyourcaronline.com
Anonymous (没有被验证)
周日, 2014-01-19 21:56
Permalink
qzftUCDkWvJKsBWyTQk
cialis stock options buy generic levitra 10mg trading platform forex very very cheap flights
Anonymous (没有被验证)
周一, 2012-08-20 13:29
Permalink
192.168.1.1/24 dev eth1
192.168.1.1/24 dev eth1 label eth1:1
Anonymous (没有被验证)
周二, 2014-01-14 03:32
Permalink
payday loans
biosyjw payday loans xnTxN payday loans xQIiV payday loans oSXIo
Anonymous (没有被验证)
周二, 2014-01-28 18:21
Permalink
paydayloansusaprd.com
nmnkbeyz paydayloansusaprd.com vmAtn payday loans 9038 quick payday loans 5806
Anonymous (没有被验证)
周一, 2014-02-10 02:06
Permalink
payday loans
utszbkv payday loans >:]] payday loans %-[[[ quickquid 5515
Anonymous (没有被验证)
周二, 2014-03-18 04:11
Permalink
befvojpd
bvrfmfd
Anonymous (没有被验证)
周三, 2014-03-19 15:52
Permalink
hello
idzxofp rikxfn
Anonymous (没有被验证)
周三, 2014-07-02 17:17
Permalink
magnum cash advance
pdlwzz magnum cash advance 1699 instant loan today ROIjlL online loans same day nLKQpn instant cash loans %-[[[
Anonymous (没有被验证)
周三, 2014-08-20 16:49
Permalink
oaufwb
ltwkod