Dear All:
I have been working on this problem for a long time, and still can?ft solve it.
It drives me crazy. I use one LVS director, with two real servers. Let?fs say,
real server A and B.
The problem is that, let?fs say, I access to the real servers from a client 100
times in one minute. Then, for example, 90/100 accesses go to the real server
A, while 10/100 go to the real server B. But each of them supposed to get
50/100.
Here is my environment, and configurations:
Red Hat Linux Advanced Server release 2.1AS/i686
Kernel 2.4.9-e.3
iptables version v1.2.4
# ipvsadm -l -n
IP Virtual Server version 0.8.1 (size=65536)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
FWM 80 dh persistent 320
-> 192.9.200.81:0 Route 1 0 0
-> 192.9.200.80:0 Route 1 0 0
# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:10:4B:18:A2:E2
inet addr:192.9.202.84 Bcast:192.9.202.255 Mask:255.255.255.0
eth0:1 Link encap:Ethernet HWaddr 00:10:4B:18:A2:E2
inet addr:192.9.202.86 Bcast:192.9.202.255 Mask:255.255.255.0
eth1 Link encap:Ethernet HWaddr 00:90:99:12:E6:92
inet addr:192.9.200.84 Bcast:192.9.200.255 Mask:255.255.255.0
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.9.200.0 0.0.0.0 255.255.255.0 U 40 0 0 eth1
192.9.202.0 0.0.0.0 255.255.255.0 U 40 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 40 0 0 lo
0.0.0.0 192.9.200.253 0.0.0.0 UG 40 0 0 eth1
Here is the configuration for the iptable:
# iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT -d 192.9.202.86
--to-destination 192.9.200.80-192.9.200.81
# service iptables save
# iptables -t nat -L
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
DNAT tcp -- anywhere 192.9.202.86 tcp dpt:http
to:192.9.200.80-192.9.200.81
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
I appreciate you to read this long message, and hope I can get some suggestions
or comments.
Thanks in advance
---------------------------------
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
|