How to find the real IP to which IPVS is routing a virtual IP

Posted by Wayne Conrad on Server Fault See other posts from Server Fault or by Wayne Conrad
Published on 2010-12-10T18:25:50Z Indexed on 2010/12/21 5:23 UTC
Read the original article Hit count: 361

Filed under:
|

I'm trying to find a problem server hiding behind a virtual IP (using LVS/ipvs). I've got a test program that sends requests to the virtual IP until it gets the bad response, but how can I tell to which real IP a request to the virtual IP got routed?

On the box doing the virtual IP magic, here's the virtual IP configuration (for the service I care about):

IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
...
TCP  10.1.0.254:5025 nq
  -> 10.1.0.5:5025                Route   1      0          1         
  -> 10.1.0.6:5025                Route   1      0          5         
  -> 10.1.0.7:5025                Route   1      0          2         
  -> 10.1.0.9:5025                Local   1      0          3         
  -> 10.1.0.11:5025               Route   1      0          3         
...

My client program is sending TCP requests to 10.1.0.254:5025, usually getting a good response but sometimes a bad response. With this few servers, I could send my request to each server in turn until I discover the culprit, but I wonder if that technique will scale as we add servers. What means exist for me to find out where requests got routed?

  • Kernel: Linux 2.6.32
  • OS: Debian testing (whatever that's called these days).
  • ipvsadm is version 1.25, compiled with ipvs v1.2.1

© Server Fault or respective owner

Related posts about linux-networking

Related posts about lvs