LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

LVS can't rotate between real servers

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Subject: LVS can't rotate between real servers
From: Longming Lee <longming@xxxxxxxxxxxxxxx>
Date: Fri, 15 Oct 2004 16:21:27 +0800
There are one LVS(RedHat 9.0, lb0) and two real servers(RedHat 7.2:rs1, rs2). 
When I reboot the LVS and start the ipvsadm(DRT mode), the clients can connect 
to real server rotationally (rs2->rs1->rs2). 

# =========start procedure:====================================
echo 0 > /proc/sys/net/ipv4/ip_forward
echo 1 > /proc/sys/net/ipv4/conf/all/send_redirects
echo 1 > /proc/sys/net/ipv4/conf/default/send_redirects
echo 1 > /proc/sys/net/ipv4/conf/eth0/send_redirects
# ***********************************************
# * 192.168.15.9 :  virtual IP of Load Balancer *
# * 192.168.15.25:  real server # 1             *
# * 192.168.15.26:  real server # 2             *
# ***********************************************
/sbin/ifconfig eth0:0 192.168.15.9 broadcast 192.168.15.9 netmask 
255.255.255.255
/sbin/route add -host 192.168.15.9 dev eth0:0
/sbin/ifconfig eth0:0
/sbin/ipvsadm -C
/sbin/ipvsadm -A -t 192.168.15.9:80 -s rr
/sbin/ipvsadm -a -t 192.168.15.9:80 -r 192.168.15.25 -g -w 1
/sbin/ipvsadm -a -t 192.168.15.9:80 -r 192.168.15.26 -g -w 1
/sbin/ipvsadm
=================================================================================
[root@bl0 download]# ipvsadm
IP Virtual Server version 1.0.9 (size=65536)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  192.168.15.9:http rr
  -> 192.168.15.26:http           Route   1      0          0
  -> 192.168.15.25:http           Route   1      0          0
=================================================================================
[root@bl0 root]# ipvsadm -Lc
IPVS connection entries
pro expire state       source             virtual            destination
TCP 00:43  SYN_RECV    192.168.15.185:1992 192.168.15.9:http  192.168.15.26:http
TCP 01:30  FIN_WAIT    192.168.8.1:1457   192.168.15.9:http  192.168.15.25:http
TCP 01:30  FIN_WAIT    192.168.8.1:1456   192.168.15.9:http  192.168.15.26:http
=================================================================================

When there are not any connection on 'ipvsadm -Lc', I connect to 
192.168.15.9(VIP)
from IE. And get the home page of 192.168.15.26. I tried from other PC to 
connect
to 192.168.15.9 and display the home page of 192.168.15.26 also.  It can't 
connect
to 192.168.15.25 and then 192.168.15.26 next time. It always only display the 
home
page of 192.168.15.26. I have put different home page in 192.168.15.25 & .26.

I deleted the 'ipvsadm' task by 'ipvsadm -C'. But I still can use IE to connect 
to
192.168.15.9 and display the home page of 192.168.15.26 also.

Whick setup procedure should be moidified to fix this problem? LVS can rotate 
between
real servers at the first time, then it doesn't after a while.


<Prev in Thread] Current Thread [Next in Thread>