LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

[lvs-users] problem setting up an LVS-NAT load balancing

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Subject: [lvs-users] problem setting up an LVS-NAT load balancing
From: "Ajay Keshavapatnam" <ajay.keshavapatnam@xxxxxxxxx>
Date: Fri, 6 Jul 2007 13:07:34 +0530
Hi all

I'm having a problem setting up an LVS-NAT load balancing scenario and am
wondering if someone can point out where i'm going wrong!


Network looks like the following (I am testing with one real server at the
moment)

[CIP]192.168.3.38 --> [eth0:162 VIP]192.168.3.162 --> [eth0
RIP]192.168.2.197
              [eth0 DIP]192.168.2.160


Director:
OS is Trustix Secure Linux - kernel 2.4.34-2tr
Ipvsadm version: 1.0.12
1 NIC
DIP Eth0 192.168.2.160
VIP Eth0:162 192.168.3.162


Real server:
OS is Fedora core 2 - kernel 2.6.5-1.358
1 NIC
Eth0 192.168.2.197


Iam following the steps in LVS mini howto to setup LVS nat.
5.2 setup by hand

Step 1: i have modified mini-rc.lvs_dr-director
 script according to my config and run the script on the director.



root@director ~# sh /root/ajay/lvs-nat-dir-setup.sh
1
0
0
0
SIOCADDRT: File exists
PING 192.168.2.197 (192.168.2.197) 56(84) bytes of data.
64 bytes from 192.168.2.197: icmp_seq=1 ttl=64 time=0.189 ms


--- 192.168.2.197 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.189/0.189/0.189/0.000 ms
IP Virtual Server version 1.0.12 (size=4096)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  192.168.3.162:http rr
  -> cccc-o4n5o2e.cccc.net:h Masq    1      0          0





Step 2: i have modified mini-rc.lvs_dr-realserver
 script according to my config and run the script on the realserver.


[root@realserver]$sh /root/ajay/lvs-nat-realserver-setup.sh
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt
Iface
192.168.2.0     0.0.0.0         255.255.254.0   U         0 0          0
eth0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0
eth0
127.0.0.0       0.0.0.0         255.0.0.0       U         0 0          0 lo
0.0.0.0         192.168.2.160   0.0.0.0         UG        0 0          0
eth0
0.0.0.0         192.168.2.3     0.0.0.0         UG        0 0          0
eth0
PING 192.168.2.160 (192.168.2.160) 56(84) bytes of data.
64 bytes from 192.168.2.160: icmp_seq=0 ttl=64 time=0.205 ms


--- 192.168.200.160 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.205/0.205/0.205/0.000 ms, pipe 2
PING 192.168.201.162 (192.168.201.162) 56(84) bytes of data.
64 bytes from 192.168.201.162: icmp_seq=0 ttl=64 time=0.309 ms


--- 192.168.3.162 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.309/0.309/0.309/0.000 ms, pipe 2
0


step 3:
root@client:~$ wget http://192.168.3.162
--12:54:30--  http://192.168.201.162/
           => `index.html.1'
Connecting to 192.168.3.162:80...


Behaviour:

When i attempt to http to the virtual IP from client, I receive no
response, ipvsadm shows one inactive connection and the following can be


RIP can ping DIP, VIP and CIP

step 4

root@director ~# ipvsadm -L -n
IP Virtual Server version 1.0.12 (size=4096)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  192.168.201.162:80 rr
  -> 192.168.200.197:80           Masq    1      0          1



NOTE:
i have a firewall running on the director
and i have cleared the iptables using iptables -F



Do let me know if you need more information to answer the query.

Any thoughts would be very much appreciated!!

Thanks in advance,
Ajay

<Prev in Thread] Current Thread [Next in Thread>
  • [lvs-users] problem setting up an LVS-NAT load balancing, Ajay Keshavapatnam <=