I'm having a weird problem with ipvsadm.
When I first configured it, it worked fine. But after about a minute of no activity, it refuses to load balance and continually goes to one server.
Here is my setup:
VIP: 10.10.10.199
Real Server 1: 10.10.10.155
Real Server 2: 10.10.10.236
Director: 10.10.10.112
I have all these running on VMs. They're all connected to the same network (I'm testing this out on a local network). On each VM, I also allow HTTP access on the firewall.
On the Director:
I start off by editing the /etc/sysctl.conf file to allow ip forwarding.
Then I type in
Quote:
sysctl -p
ifconfig eth0:0 10.10.10.199 netmask 255.255.0.0. broadcast 172.17.255.255
ipvsadm -A -t 10.10.10.199:80 -s rr
ipvsadm -a -t 10.10.10.199:80 -r 10.10.10.155:80 -g
ipvsadm -a -t 10.10.10.199:80 -r 10.10.10.236:80 -g
|
After that, I try typing in ipvsadm to check it to make sure I have it all set up properly.
On the real servers, I do the same for both.
I go into the file /etc/sysctl.conf and I add in these lines:
net.ipv4.conf.eth0:0.arp_ignore = 1
net.ipv4.conf.eth0:0.arp_announce = 2
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2
I add an index.html text file to /var/www/html (my DocumentRoot for apache) with just the server IP address. I start httpd.
Then on my computer (not on the VMs), I type in 10.10.10.199, and refresh it a good number of times. Each time I refresh, it gives me the other server, which is GREAT, right?
WRONG.
I go to document what I did to get it working on my notebook. Then I go into the sysctl.conf file again to see exactly what it was I typed in there. Then I refresh my browser again... AND IT STOPS WORKING.
Instead of load balancing, it keeps taking me to the first server. When I pause the first server on my VM, IE keeps showing that html page.
I then figured maybe it had to do with IE, and it would work on firefox. WRONG AGAIN.
On Firefox, it doesn't even load anything. I get an error "The connection has timed out".
I KNOW that Real Server 2 is running. I typed in the IP address into the browser and it came up with the proper HTML page. I have no idea what went wrong.
Does this have something to do with me doing this on a local network?
Does it have something to do with my internet browsers?
Is there maybe something wrong with my director server?
Can somebody please help me
?