From: Tim McAuley (mcauleyt at domain tcd.ie)
Date: Fri 24 Aug 2001 - 12:27:12 IST
Okay... this is driving me mad and I need some help.
I am trying to set-up the LinuxVirtualServer for use in a load balancing
system and can't get it running correctly, well kind of. Let me explain.
I have a Linux box set-up, running kernel 2.2.19 (also been trying 2.4),
with the LVS patch. That is running fine. My problem seems to be my network
set-up of the boxes. Each of the boxes I use has their main address set to
192.168.0.<something>. This causes problems with the load balancing because
the real server can connect to the client directly (using ICMP redirects). I
did in fact manage to the get the load balancing working with the
configuration below:
Client: 192.168.0.10 (my PC, Win NT 4)
Load Balancer 192.168.0.109 & 192.168.2.1
Real Server 192.168.2.2
but in this case I had been messing around with the load balancer quite a
bit, and also removed the 192.168.0.# route from the real server, making it
inaccessible to others. It does, however, show that the needed components
are compiled into the kernel (which was the raw source from kernel.org)
What I would like to set-up is this:
Client: 192.168.3.2 (Linux box this time)
Connects to Load Balancer: 192.168.3.1 & 192.168.2.1
Connect to Real server 192.168.2.2
This way, I hope that all the machines can still use their 192.168.0.#
addresses, and remain accessible to everyone else. I can then also use other
machines as backend/real servers by giving them an extra 192.168.2.# address
and adding them to the ipvsadm configuration.
I set this up like so:
Added 192.168.3.2 using ifconfig to the client, netmask 255.255.255.0,
eth0:0
Added 192.168.3.1 using ifconfig to the load balancer, netmask
255.255.255.0, eth0:0
Added 192.168.2.2 using ifconfig to the load balancer, netmask
255.255.255.0, eth0:0
Added 192.168.2.2 using ifconfig to the real server, netmask 255.255.255.0,
eth0:0
route add -net 192.168.3.0 netmask 255.255.255.0 gw 192.168.2.1 (to bypass
the default route)
LVS set-up script:
----------------
#!/bin/bash
modprobe ip_vs_rr
ipvsadm -C
ipvsadm -A -t 192.168.3.1:80 -s rr
ipvsadm -a -t 192.168.3.1:80 -r 192.168.2.2:80 -w 1 -m
---------------
This is not working at present.
On the load balancer I have enabled ip_forwarding, and ip_always_defrag
(what the equivalent on 2.4?).
I can't get this to work. What am I missing out? Either on the LVS
configuration, or on the general network config. And will using second IP
addresses on the NICs work correctly with LVS i.e. eth0:0, eth0:1? (in the
production system, we will have two NICS)
Other notes:
- ipchains is cleared, i.e. ipchains -F
- I have tried setting various settings under /proc/sys/net/ipv4 but to no
avail, i.e. echo 0 > /proc/sys/net/ipv4/conf/eth0/send_redirects
- after getting it working the first time, I reset the boxes (it's quicker),
and tried to get it working again, using the new configuration. To date
proper success.
Any help is appreciated. I really think I'm missing something quite
fundamental here, and/or my network theory is a bit rusty!
;-)
Thanks,
Tim
This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:11:48 GMT