0

I've encountered a weird bug and ran out of ways to troubleshoot it.

I've set up 3 virtual machines: LVS, RS1 and RS2. RS1 and RS2 are running a simple php website. RS2 is an exact copy of RS1 with only the ip address changed. All of the machines are conected to a local network (1.1.1.0/24). Here's my ipvsadm config:

echo "1" > /proc/sys/net/ipv4/ip_forward
echo "0" > /proc/sys/net/ipv4/conf/all/send_redirects
echo "0" > /proc/sys/net/ipv4/conf/default/send_redirects
echo "0" > /proc/sys/net/ipv4/conf/eth0/send_redirects

LVS_IP=192.168.1.180
RS1_IP=1.1.1.2
RS2_IP=1.1.1.3
ipvsadm -A -t $LVS_IP:www -s rr         
ipvsadm -a -t $RS1_IP:www -r $RS1_IP:www -m -w 1
ipvsadm -a -t $RS2_IP:www -r $RS2_IP:www -m -w 2

Running links 1.1.1.2 and links 1.1.1.3 displays the same positive result - the contents of my webpage.

However, running links 192.168.1.180 (LVS's external IP) gives me proper results... but only every other time (50% of requests). It seems that when the LVS round-robins the request to RS2, there's just no response. (links says "Making connection..." and then nothing happens).

How can I attempt debugging such an issue?

womble
  • 95,029
  • 29
  • 173
  • 228
Kuba Orlik
  • 651
  • 1
  • 5
  • 9

1 Answers1

1

You debug this with the help of your trusty tcpdump. Start by capturing the packets on the realserver that's having the problem, and if nothing's immediately obviously wrong, compare it against an equivalent capture on the working realserver. At some point they'll look different, because the behaviour is different; what is different will point you very strongly in the right direction. Packets don't make it to the realserver? Firewall problem on the loadbalancer. Packets don't make it back out of the realserver? Could be outgoing firewall problems, or the realserver's webserver isn't playing nicely with others.

womble
  • 95,029
  • 29
  • 173
  • 228
  • Thank you for your answer. Unfortunately I'm no longer involved in the project, so I cannot use you method to solve that particular case. – Kuba Orlik Aug 14 '15 at 11:13