LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

[lvs-users] Simple HTTP load balancing

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Subject: [lvs-users] Simple HTTP load balancing
From: "Sebastien Termeau" <st@xxxxxxxxxxxxxxxx>
Date: Tue, 28 Oct 2008 15:31:31 +0100
Hi,

I am trying to setup a simple http load balancing between two servers.
I already did the same to load balance mysql queries on two servers and it
was working fine.
However I cannot get it working with HTTP.
To simply everything I decided to work with only one server but it is the
same behavior with two servers.
As soon as I try to connect to the VIP:80, the InActConn counter is
increased by 1.
I also check with tcpdump to see what happen. When I try to connect to the
VIP on port 80, the VIP reply with RST/ACK packet.
Am i missing something? What is wrong with my setup?
Many thanks

The following interfaces are available:
          eth0      Link encap:Ethernet  HWaddr 00:1E:C9:B8:ED:15
          inet addr:192.168.1.149  Bcast:192.168.1.255  Mask:255.255.255.0
          eth0:0    Link encap:Ethernet  HWaddr 00:1E:C9:B8:ED:15
          inet addr:192.168.1.61  Bcast:192.168.1.255  Mask:255.255.255.0

Apache is listening on the real-ip
  tcp        0      0 192.168.1.149:80            0.0.0.0:*
LISTEN      4502/httpd

My ldirectord configuration:
#######################
#Global Directives
checktimeout=10
checkinterval=10
autoreload=yes
logfile="/var/log/ldirectord.log"
quiescent=yes

virtual = 192.168.1.61:80
        real=192.168.1.149:80 gate
        service=http
        request="index.html"
        receive="alive"
        scheduler=wrr
        persistent=1800
        protocol=tcp
        checktype=negotiate
#######################


>>> ipvsadm -Ln
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  192.168.1.61:80 wrr persistent 1800
  -> 192.168.1.149:80             Local   1      0          2


>>>>ipvsadm -Lnc
IPVS connection entries
pro expire state       source             virtual            destination
TCP 00:57  SYN_RECV    192.168.1.245:43301 192.168.1.61:80
192.168.1.149:80
TCP 00:57  SYN_RECV    192.168.1.245:43300 192.168.1.61:80
192.168.1.149:80
TCP 00:56  SYN_RECV    192.168.1.245:43298 192.168.1.61:80
192.168.1.149:80

I am using a RHEL 5.2 ( I also tried with Centos ) with
  heartbeat-2.1.3-3.el5.centos
  heartbeat-stonith-2.1.3-3.el5.centos
  heartbeat-pils-2.1.3-3.el5.centos
  heartbeat-ldirectord-2.1.3-3.el5.centos

My /etc/sysctl.conf
########################
# Controls IP packet forwarding
net.ipv4.ip_forward = 1
net.ipv4.conf.default.forwarding=1

net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.eth0.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2
net.ipv4.conf.eth0.arp_announce = 2

# Controls source route verification
net.ipv4.conf.default.rp_filter = 1

# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0
########################

<Prev in Thread] Current Thread [Next in Thread>
  • [lvs-users] Simple HTTP load balancing, Sebastien Termeau <=