Using LVS to forward HTTP from port 80 to servers running on port 81
Travis Melhiser
tmelhiser at hotmail.com
Thu Jul 13 22:46:27 BST 2006
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 at byu.edu>
>Reply-To: "LinuxVirtualServer.org users mailing list."
><lvs-users at LinuxVirtualServer.org>
>To: "LinuxVirtualServer.org users mailing list."
><lvs-users at linuxvirtualserver.org>
>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
> >
> > _________________________________________________________________
> > Dont 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 at LinuxVirtualServer.org
> > Send requests to lvs-users-request at LinuxVirtualServer.org
> > or go to http://www.in-addr.de/mailman/listinfo/lvs-users
> >
> >
> >
>
>_______________________________________________
>LinuxVirtualServer.org mailing list - lvs-users at LinuxVirtualServer.org
>Send requests to lvs-users-request at LinuxVirtualServer.org
>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/
Search lvs-users Archives
More information about the lvs-users
mailing list