LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: LVS-NAT configuration

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: LVS-NAT configuration
From: Nelson Castillo <nelsoneci@xxxxxxxxx>
Date: Tue, 18 Oct 2005 13:31:20 -0500
> >>Should the DIP be a virtualDIP and controlled by heartbeat?
> >>(then heartbeat would control VIP and DIP)...I think
> >>I'm missing something...

Well, that can be done and I had to do it. But you might
not need it and it's easier if you use heartbeat only for
the DIP.

> I don't understand, I'm using heartbeat,
>should I use keepalived instead? or just
>heartbeat is enough to deal with the problem
>of the default gw in the realservers?

Heartbeat is enough (I guess you have at least 2 directors
and want to manage the DIP using heartbeat).

> (I've been reading keepalived documentation and
>it doesn't seem to be as simple as heartbeat)

Yup. They're different.

For the LVS you can:

1) start the LVS by hand (or using some scripts)
2) use keepalived (I think it's easier).

Your choice, anyway. You must choose one.
(maybe there are more options that I don't know of).

Now, you can start the LVS from heartbeat.
Heartbeat will: 1) set the DIP, and then,
2) start the LVS

In this setup, your heartbeat configuration might
look like this one (assuming you used keepalived):

director IPaddr::10.0.0.1/8/eth1/10.255.255.255 \
             keepalived

That is, set the DIP and then start keepalived
(which will configure the LVS).

And keepalived is not hard. Here's an untested example
for a simple LVS with VIP=192.168.0.2 and 2 real
servers in the subnet 10.0.0.0/8. Using port 80.

global_defs {
  notification_email {
    example@xxxxxxxxxxx
    example1@xxxxxxxxxxx
  }
  notification_email_from example@xxxxxxxxxxx
  smtp_server 127.0.0.1
  smtp_connect_timeout 30
}

virtual_server 192.168.0.2 80{
    delay_loop 6
    lb_algo rr
    lb_kind NAT
    persistence_timeout 50
    protocol TCP

  real_server 10.0.0.2 80{
    weight 1
    TCP_CHECK {
      connect_port    80
      connect_timeout 3
    }
  }

  real_server 10.0.0.3 80{
    weight 1
    TCP_CHECK {
      connect_port    80
      connect_timeout 3
    }
  }
}

--
Homepage : http://geocities.com/arhuaco

The first principle is that you must not fool yourself
and you are the easiest person to fool.
     -- Richard Feynman.

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