LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: [lvs-users] more realserver ports question - long mail

To: "'LinuxVirtualServer.org users mailing list.'" <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: [lvs-users] more realserver ports question - long mail
From: Kun Richárd <kun.richard@xxxxxxxxx>
Date: Tue, 1 Dec 2009 17:25:16 +0100
Hi,

Let me specifying the problem, in details. 

I want to serving a website with two machines (A,B), in
loadbalancing-failover enviroment. I have two IP-s, assuming 10.0.2.40 and
10.0.2.39.
The dynamic part of the site will be served by apache+php, listening on
10.0.2.40:80, and the static part of the site (css,images) will be served by
a lighttpd, listening on 10.0.2.39:80
If apache runs on the box A, and lighttpd runs on the box B, both of the
machines are SPOF, so I have to think up something.

I plan to use IPs as VIP addresses, and I want to use 4 more IPs as
realservers. Like this, one box can serve the whole page, and the other box
is not idle.

haresources:
deb1     \
    ldirectord::ldirectord.cf \
    LVSSyncDaemonSwap::master \
    IPaddr::10.0.2.40/24/eth0/10.0.2.255 \
    IPaddr::10.0.2.39/24/eth0/10.0.2.255 \

My ldirectord.cf look like:
virtual = 10.0.2.40:80
        real = 10.0.2.10:80 gate 10
        real = 10.0.2.11:80 gate 10
        service = http
        scheduler = rr
        protocol = tcp
        request = "test.html"
        receive = "OK"
        checktype = negotiate

virtual = 10.0.2.39:80
        real = 10.0.2.20:80 gate 10
        real = 10.0.2.21:80 gate 10
        service = http
        scheduler = rr
        protocol = tcp
        request = "test.html"
        receive = "OK"
        checktype = negotiate



The IPs 10.0.2.10 and 10.0.2.20 are on the box A, and the IPs 10.0.2.11 and
10.0.2.21 are on the box B.

I need setting up dummy0 and dummy0:0 interfaces on both of the machines
with 10.0.2.39 and 10.0.2.40, thus apache and lighttpd can bind on this IPs.

Now comes the problem: If the heartbeat starts, it drops the dummy0:0
interface with IP 10.0.2.39, but the 10.0.2.40 on the dummy0 remains
untouched.

This reason the lighttpd can't serve request on this IP.

If I call ifdown dummy0:0 and ifup dummy0:0, the system works perfectly. How
can I make it reboot-safe, and failover safe?


This is relevant line of the log:

ResourceManager[2614]:  2009/12/01_19:50:21 info: Running
/etc/ha.d/resource.d/IPaddr 10.0.2.40/24/eth0/10.0.2.255 start
ResourceManager[2614]:  2009/12/01_19:50:21 debug: Starting
/etc/ha.d/resource.d/IPaddr 10.0.2.40/24/eth0/10.0.2.255 start
IPaddr[2890]:   2009/12/01_19:50:22 INFO: Using calculated netmask for
10.0.2.40: 255.255.255.0
IPaddr[2890]:   2009/12/01_19:50:22 INFO: eval ifconfig eth0:1 10.0.2.40
netmask 255.255.255.0 broadcast 10.0.2.255
IPaddr[2890]:   2009/12/01_19:50:22 DEBUG: Sending Gratuitous Arp for
10.0.2.40 on eth0:1 [eth0]
IPaddr[2861]:   2009/12/01_19:50:22 INFO:  Success
INFO:  Success
ResourceManager[2614]:  2009/12/01_19:50:22 debug:
/etc/ha.d/resource.d/IPaddr 10.0.2.40/24/eth0/10.0.2.255 start done. RC=0
IPaddr[3025]:   2009/12/01_19:50:23 ERROR: 10.0.2.39 is running an interface
(dummy0) instead of the configured one (eth0)
IPaddr[2996]:   2009/12/01_19:50:23 ERROR:  Generic error
ResourceManager[2614]:  2009/12/01_19:50:23 info: Running
/etc/ha.d/resource.d/IPaddr 10.0.2.39/24/eth0/10.0.2.255 start
ResourceManager[2614]:  2009/12/01_19:50:23 debug: Starting
/etc/ha.d/resource.d/IPaddr 10.0.2.39/24/eth0/10.0.2.255 start
IPaddr[3105]:   2009/12/01_19:50:24 INFO: Using calculated netmask for
10.0.2.39: 255.255.255.0
IPaddr[3105]:   2009/12/01_19:50:24 ERROR: 10.0.2.39 is running an interface
(dummy0) instead of the configured one (eth0)
IPaddr[3105]:   2009/12/01_19:50:25 INFO: eval ifconfig eth0:2 10.0.2.39
netmask 255.255.255.0 broadcast 10.0.2.255
IPaddr[3105]:   2009/12/01_19:50:25 DEBUG: Sending Gratuitous Arp for
10.0.2.39 on eth0:2 [eth0]
IPaddr[3105]:   2009/12/01_19:50:25 ERROR: 10.0.2.39 is running an interface
(dummy0) instead of the configured one (eth0)
IPaddr[3076]:   2009/12/01_19:50:25 ERROR:  Generic error
ERROR:  Generic error



--
Üdv,
 Ricsi


> -----Original Message-----
> From: lvs-users-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:lvs-users-
> bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Simon Horman
> Sent: Friday, November 27, 2009 1:16 PM
> To: LinuxVirtualServer.org users mailing list.
> Subject: Re: [lvs-users] more realserver ports question
> 
> On Thu, Nov 26, 2009 at 10:29:26AM -0800, James H wrote:
> > Here is a patch to the RedHat Pulse/Piranha system that let's you use
> > NAT port rewriting:
> >
> > http://mobiuscircle.com/2009/06/08/piranhapulse-patch-allow-port-
> rewriting-in-nat-mode/
> >
> > This patch adds the ability for you to set a port in the real server
> > config section in /etc/sysconfig/ha/lvs.conf
> >
> > eg:
> > ...
> > virtual http-shared {
> >      port = 80
> >      ...
> >      server rack104 {
> >          address = 192.168.2.104
> >          port = 8080 <==== Isn't normally supported by pulse/piranha
> >          active = 1
> >          weight = 1
> >      }
> > ...
> > }
> > ...
> 
> What does ipvsadm -Ln look like with this in effect?
> I'm curious to know where the port translation is taking place.
> 
> 
> _______________________________________________
> Please read the documentation before posting - it's available at:
> http://www.linuxvirtualserver.org/
> 
> LinuxVirtualServer.org mailing list - lvs-users@xxxxxxxxxxxxxxxxxxxxxx
> Send requests to lvs-users-request@xxxxxxxxxxxxxxxxxxxxxx
> or go to http://lists.graemef.net/mailman/listinfo/lvs-users


_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/

LinuxVirtualServer.org mailing list - lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Send requests to lvs-users-request@xxxxxxxxxxxxxxxxxxxxxx
or go to http://lists.graemef.net/mailman/listinfo/lvs-users

<Prev in Thread] Current Thread [Next in Thread>
  • Re: [lvs-users] more realserver ports question - long mail, Kun Richárd <=