LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: Using LVS to forward HTTP from port 80 to servers running onport 81

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: Using LVS to forward HTTP from port 80 to servers running onport 81
From: "Travis Melhiser" <tmelhiser@xxxxxxxxxxx>
Date: Thu, 13 Jul 2006 17:51:57 -0400
Arg, doctored half the ip addresses but not the other half... so to make that last post make a bit more sense:

Our ldirectord.conf file looks like this:
-------------------------------------------

checktimeout=10
checkinterval=2
autoreload=yes
logfile="local0"
quiescent=yes

virtual=192.168.1.99:80
      real=192.168.1.100:81 masq
      real=192.168.1.101:81 masq
      fallback=127.0.0.1:80 gate
      request="/heartbeat/index.html"
      receive="Alive"
      scheduler=rr
      service=http
      protocol=tcp
      checktype=negotiate
-------------------------------------------------

Output from ipvsadm after ldirector is started:

ipvsadm -L -n
-------------------------------------------------
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  192.168.1..99:80 rr
-> 192.168.1.100:81            Masq    1      0          0
-> 192.168.1.101:81            Masq    1      0          0

-------------------------------------------------


Sorry again for the confusion.

-t


From: "Travis Melhiser" <tmelhiser@xxxxxxxxxxx>
Reply-To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: Using LVS to forward HTTP from port 80 to servers running onport 81
Date: Thu, 13 Jul 2006 17:46:27 -0400

I'm using ldirectord here as well.

Our ldirectord.conf file looks like this:
-------------------------------------------

checktimeout=10
checkinterval=2
autoreload=yes
logfile="local0"
quiescent=yes

virtual=192.168.1.99:80
       real=192.168.1.100:81 masq
       real=192.168.1.101:81 masq
       fallback=127.0.0.1:80 gate
       request="/heartbeat/index.html"
       receive="Alive"
       scheduler=rr
       service=http
       protocol=tcp
       checktype=negotiate
-------------------------------------------------

Output from ipvsadm after ldirector is started:

ipvsadm -L -n
-------------------------------------------------
Prot LocalAddress:Port Scheduler Flags
 -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  147.26.119.99:80 rr
 -> 147.26.119.215:81            Masq    1      0          0
 -> 147.26.119.164:81            Masq    1      0          0

-------------------------------------------------


However, I cannot reach the web server via the VIP.

-Travis

From: Lloyd Brown <somewhere_or_other@xxxxxxx>
Reply-To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx> To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx> Subject: Re: Using LVS to forward HTTP from port 80 to servers running on port 81
Date: Thu, 13 Jul 2006 15:33:00 -0600

I think you can just specify the source and destination ports when you
add the services; iptables isn't really necessary.  So, basically in the
man page for ipvsadm, where it says "service-address", you'd put your
external hostname/IP address followed by a port, something like this:

external-server:80

Similarly, when you specify the "server-address" (meaning the
realserver), you just append a ":81" to the hostname or IP.

So, to associate "server1" on port 81 as a realserver under "external"
on port 80, using LVS-NAT with a weight of 1, you'd try something like
this (someone should check my syntax here):

"ipvsadm -a -t external:80 -r server1:81 -m -w 1"

I'm not sure if this will be helpful, but we use ldirectord at my work,
and so your configuration would be something like this, in this
situation (assuming LVS-NAT & weight of 1 again):

...
virtual=external:80
        real=server1:81 masq 1
        real=server2:81 masq 1
        real=server3:81 masq 1
... (etc)


Hope this helps,
Lloyd Brown


Travis Melhiser wrote:
> I'm pretty new to LVS and can't seem to find the right configuration or
> the right documentation to get my environment set up.
>
> I would like to have requests come to the LVS server on port 80 an then
> have the LVS server forward these requests to the machines in the
> cluster running the web servers on port 81.
>
> Does anyone have an example of how to set this up?
>
> Thanks in advance,
>
> -T
>
> _________________________________________________________________
> Don?t just search. Find. Check out the new MSN Search!
> http://search.msn.click-url.com/go/onm00200636ave/direct/01/
>
> _______________________________________________
> LinuxVirtualServer.org mailing list - lvs-users@xxxxxxxxxxxxxxxxxxxxxx
> Send requests to lvs-users-request@xxxxxxxxxxxxxxxxxxxxxx
> or go to http://www.in-addr.de/mailman/listinfo/lvs-users
>
>
>


_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


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