LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

RE: Director and Real Server: Same Machine

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: RE: Director and Real Server: Same Machine
From: "Mikel RUIZ ECHEVERRIA" <mikel.ruiz@xxxxxx>
Date: Wed, 6 Jul 2005 11:07:41 +0200
Thank you, Horms. You were very clear. I think I understood what happened,
and I can't map ports if  I am not dealing with NAT.

You suggested to change Ips instead of ports. It's a good point of view.
This should solve the problem.

virtual=158.227.82.39:8090
         real=127.0.0.1:8090
         real=127.0.0.2:8090

I configure one httpd.conf to Listen 127.0.0.1:8090 and the second
127.0.0.2:8090
It stays in Syn_Recv state. Perhaps I am not doing things as you told.

On the other hand, LVS-HOWTO says (point 8, first note) that if we want to
set up Local Nodes, we have to have the service (e.g. apache) configured  to
Listen to VIP. Keeping this in mind, how could what you suggested work (how
could what I understood work)?

Thanks again for your time.




-----Mensaje original-----
De: lvs-users-bounces@xxxxxxxxxxxxxxxxxxxxxx
[mailto:lvs-users-bounces@xxxxxxxxxxxxxxxxxxxxxx]En nombre de Horms
Enviado el: miércoles, 08 de junio de 2005 4:06
Para: LinuxVirtualServer.org users mailing list.
Asunto: Re: Director and Real Server: Same Machine

On Tue, Jun 07, 2005 at 03:16:13PM +0200, Mikel RUIZ ECHEVERRIA wrote:
> I would like to balance the service over two real instances running all on
> the same machine.
>
> I have tried ldirectord.cf:
> ...
> virtual=158.227.82.39:8090
>         real=158.227.82.39:8091
>         real=158.227.82.39:8092
>
> And I also have tried:
> ...
> virtual=158.227.82.39:8090
>         real=127.0.0.1:8091
>         real=127.0.0.1:8092
> ...
> but when I start ldirector daemon, I get:
> "Starting ldirectord Error [] reading file /etc/ha.d/conf/ldirectord.cf at
> line 14: invalid address for real server (wrong format)"
>
> It seems like IPs of Real Servers could not be the same as the Director
> Server's one.
>
> Must  Director and Real Servers run on different machines to work properly
> with LVS?

Unfortunately, what you are trying to do is not possible, and
here is why:

When you set up a real server that is on the same machine
as LVS, it uses a special forwarding mechanism called Local.
It uses this regardless of weather you asked for Masq, Route or
Tun. You can't ask for it, it just knows if the address is
local and sets it. You can however observe it using ipvsadm -L.

The reason for this is running packages that are going to
be delivered to a local process through Masq, Route or Tun
has overhead and in most cases makes very little sense.

However, the downside is that the Local forwarding
mechanism (like Route and Tun, but) unlike Masq
does not allow port-mapping. That is, your port 8090
packets will stay as port 8090 packets. So in a nutshell
IPVS translates your configuration to.

virtual=158.227.82.39:8090
         real=158.227.82.39:8090
         real=158.227.82.39:8090

Which obiously isn't going to workm because you have a duplicate
entry, and that is what the error message you are getting
is trying to say. Well, thats what it should be trying to say,
looks like there might be a bit of a bug in ldirectord somewhere,
but that doesn't change the fact that IPVS can't do what
you want to do.

I believe an easy solution to this problem would
be to deliver the packets to different addresses
rather than different ports. Something like the
following might just work.

virtual=158.227.82.39:8090
         real=127.0.0.1:8090
         real=127.0.0.2:8090

A longer term solution would be to fix up the way the
Local delivery mechanism works. But this would
likely be quite tricky, and certainly increase
its current complexity - its basically a NULL opp
at the moment.

--
Horms


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