LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: [lvs-users] using LVS on the director with a local VIP directing to

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: [lvs-users] using LVS on the director with a local VIP directing to realserver ?
From: Sylvain Viart <sylvain@xxxxxxxxxxxxxxxxx>
Date: Fri, 18 Apr 2008 11:28:42 +0200
Hi,

Sylvain Viart a écrit :
>> to answer the subject line
>>
>> http://www.austintek.com/LVS/LVS-HOWTO/mini-HOWTO/LVS-mini-HOWTO.html#gotchas
>>     
The above link is ok.

The link on the faq is broken ( May 2004: Joshua Goodall has figured out 
how to have a director be a client with LVS-DR 
<http://www.austintek.com/LVS/LVS-HOWTO/HOWTO/LVS-HOWTO.realserver_director_as_client.html#director_as_client_in_LVS-DR>.),
 
the good one seems :

http://www.austintek.com/LVS/LVS-HOWTO/HOWTO/LVS-HOWTO.LVS-DR.html#director_as_client_in_LVS-DR

 From the faq link given by Joseph :
>
> To set up and test/run LVS, you need a minimum of 3 machines: client, 
> director, realserver(s).
>
> From the outside, the LVS functions as one machine. The client cannot 
> be one of the machines in the LVS (the director, or realserver). You 
> need an outside client. If you try to access an LVS controlled service 
> (eg http, smtp, telnet) from any of the machines in the LVS; access 
> from the director will hang, access from a realserver will connect to 
> the service locally, bypassing the LVS.
>
Effectively I want to do the following on the same physical server:

    * Listen on public IP:80 with squid
    * squid redirect in accelerator mode on a "virtual peer" hosted on
      the same physical server => 10.0.10.1:8080
    * LVS VIP is on the 10.0.10.1 wich is also the DIP?
          o I'm not sure about this part...

Here is the current server private IP configuration:

eth1      Link encap:Ethernet  HWaddr 00:20:ED:83:E6:3F
          inet addr:10.0.1.1  Bcast:10.0.255.255  Mask:255.255.0.0

eth1:php- Link encap:Ethernet  HWaddr 00:20:ED:83:E6:3F
          inet addr:10.0.10.1  Bcast:10.0.255.255  Mask:255.255.0.0


What I would like to do:

   1. incoming http resquest public_IP:80 (squid)
          * using internal squid redirector to direct the http request
            on 10.0.10.1:8080
   2. LVS loabalance 10.0.10.1:8080 to some real server on 10.0.2.150:80
      and more.
   3. 10.0.2.150:80 reply to the squid (trough LVS loadblancer)
   4. squid cache the page if any
   5. squid return the reply on is public interface to the client

The goal it to embed the loadbalancer on the same physical server.

                       Public IP :80
                       ____|_____
                      |          |
                      | squid:80 | -------+ local redirect 
10.0.10.1:8080 (VIP)
                      |__________|        |
                      |          |        |
                      | director |<-------+
                      |__________|
                          DIP = VIP + local IP 10.0.1.1
                           |
                           |
          -----------------+----------------
          |                |               |
          |                |               |
         RIP1             RIP2            RIP3
    ____________     ____________     ____________
   |            |   |            |   |            |
   | realserver |   | realserver |   | realserver |
   |____________|   |____________|   |____________|                 


Reading the "7.10. Director as client in LVS-DR"

It seems I need to patch the code source.
Is it still needed?

I use kernel : 2.6.22-2-686

I really need to bypass : "2.2. Gotchas: you need an outside client (the 
director and realservers can't access the virtual service)", and it 
seems to be possible.

Regards,
Sylvain.

<Prev in Thread] Current Thread [Next in Thread>