Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux Virtual Server: Users

[lvs-users] load balancing works... kinda

 

 

Linux Virtual Server users RSS feed   Index | Next | Previous | View Threaded


cwilliams.work at gmail

Feb 13, 2008, 7:41 AM

Post #1 of 12 (723 views)
Permalink
[lvs-users] load balancing works... kinda

I've setup the ultra monkey package on two machines running RHEL4 64 bit.
For testing purposes I have the load balancers running on two different
machines, loadb1 and loadb2 and I also have an apache server running on port
8080 of the loadb1 machine. When the active load balancer is loadb1 I get
connection reset or connection unavailable when trying to reach my virtual
ip address. When the active load balancer is loadb2 everything works fine.
I'll include my conf files and hopefully someone can point out where I went
wrong.

loadb1 ip = 192.168.1.109
loadb2 ip = 192.168.1.117
gateway ip = 192.168.1.1
virtual ip = 192.168.1.105

I've omitted the ha.cf and haresources files because my message keeps
getting rejected as spam, if you guys need to see them I can add them in a
response email

[ldirectord.cf]
checktimeout=15
checkinterval=5
autoreload=no
logfile="/var/log/ldirectord.log"
quiescent=yes

virtual=192.168.1.105:8080
real=192.168.1.109:8080 gate
fallback=127.0.0.1:8080 gate
service=http
request="ldirectord.html"
receive="Test Page"
scheduler=rr
protocol=tcp
checktype=negotiate
persistent=600

[/etc/sysctl.conf]
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.eth0.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2
net.ipv4.conf.eth0.arp_announce = 2
net.ip4.ip_forward = 1

on the active load balancer inet 192.168.1.105/24 brd 192.168.1.255 scope
global secondary eth0 is added to eth0
<http://192.168.1.117/>
on loadb1 I've also configured eth0 to point back to the gateway by
modifying

[etc/sysconfig/network-scripts/ifcfg-eth0]
DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
TYPE=Ethernet
IPADDR=192.168.1.109
NETMASK=255.255.255.0
GATEWAY=192.168.1.1

These configurations are identical on both loadb1 and loadb2, except for the
ifcfg-eth0 configuration. Does anyone see where I'm going wrong?

Thanks,

-Charlie Williams
_______________________________________________
LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
Send requests to lvs-users-request [at] LinuxVirtualServer
or go to http://lists.graemef.net/mailman/listinfo/lvs-users


jmack at wm7d

Feb 13, 2008, 8:28 AM

Post #2 of 12 (696 views)
Permalink
Re: [lvs-users] load balancing works... kinda [In reply to]

On Wed, 13 Feb 2008, Charlie Williams wrote:

> I've setup the ultra monkey package on two machines running RHEL4 64 bit.
> For testing purposes I have the load balancers running on two different
> machines, loadb1 and loadb2 and I also have an apache server running on port
> 8080 of the loadb1 machine.

if this is running in localnode mode, you can't rewrite the
port

Joe

--
Joseph Mack NA3T EME(B,D), FM05lw North Carolina
jmack (at) wm7d (dot) net - azimuthal equidistant map
generator at http://www.wm7d.net/azproj.shtml
Homepage http://www.austintek.com/ It's GNU/Linux!

_______________________________________________
LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
Send requests to lvs-users-request [at] LinuxVirtualServer
or go to http://lists.graemef.net/mailman/listinfo/lvs-users


cwilliams.work at gmail

Feb 13, 2008, 8:30 AM

Post #3 of 12 (696 views)
Permalink
Re: [lvs-users] load balancing works... kinda [In reply to]

not sure what you mean by that. What is localnode mode? How am I re-writing
the port?

-Charlie

On Feb 13, 2008 11:28 AM, Joseph Mack NA3T <jmack [at] wm7d> wrote:

> On Wed, 13 Feb 2008, Charlie Williams wrote:
>
> > I've setup the ultra monkey package on two machines running RHEL4 64
> bit.
> > For testing purposes I have the load balancers running on two different
> > machines, loadb1 and loadb2 and I also have an apache server running on
> port
> > 8080 of the loadb1 machine.
>
> if this is running in localnode mode, you can't rewrite the
> port
>
> Joe
>
> --
> Joseph Mack NA3T EME(B,D), FM05lw North Carolina
> jmack (at) wm7d (dot) net - azimuthal equidistant map
> generator at http://www.wm7d.net/azproj.shtml
> Homepage http://www.austintek.com/ It's GNU/Linux!
>
> _______________________________________________
> LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
> Send requests to lvs-users-request [at] LinuxVirtualServer
> or go to http://lists.graemef.net/mailman/listinfo/lvs-users
>
_______________________________________________
LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
Send requests to lvs-users-request [at] LinuxVirtualServer
or go to http://lists.graemef.net/mailman/listinfo/lvs-users


graeme at graemef

Feb 13, 2008, 8:49 AM

Post #4 of 12 (696 views)
Permalink
Re: [lvs-users] load balancing works... kinda [In reply to]

On Wed, 2008-02-13 at 10:41 -0500, Charlie Williams wrote:
> I've setup the ultra monkey package on two machines running RHEL4 64 bit.
> For testing purposes I have the load balancers running on two different
> machines, loadb1 and loadb2 and I also have an apache server running on port
> 8080 of the loadb1 machine.

Try to ensure that Apache is only bound to 127.0.0.1:8080 on loadb1.

If you let it "Listen *:8080" or similar, it'll bind to the virtual IP
too.

Graeme


_______________________________________________
LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
Send requests to lvs-users-request [at] LinuxVirtualServer
or go to http://lists.graemef.net/mailman/listinfo/lvs-users


cwilliams.work at gmail

Feb 13, 2008, 11:51 AM

Post #5 of 12 (702 views)
Permalink
Re: [lvs-users] load balancing works... kinda [In reply to]

that worked for the local server, then I attempted to setup a 3rd machine
solely running an apache server, ldirectord is able to reach its test page,
and indicates that the server is available, but requests are not getting
through from the virtual ip to the apache server (I see no accesses in the
apache log from anything other than ldirectord), I don't see any indication
of errors. Should I even be using direct routing? Would tunneling be a
better scalable solution anyway?

On Feb 13, 2008 11:49 AM, Graeme Fowler <graeme [at] graemef> wrote:

> On Wed, 2008-02-13 at 10:41 -0500, Charlie Williams wrote:
> > I've setup the ultra monkey package on two machines running RHEL4 64
> bit.
> > For testing purposes I have the load balancers running on two different
> > machines, loadb1 and loadb2 and I also have an apache server running on
> port
> > 8080 of the loadb1 machine.
>
> Try to ensure that Apache is only bound to 127.0.0.1:8080 on loadb1.
>
> If you let it "Listen *:8080" or similar, it'll bind to the virtual IP
> too.
>
> Graeme
>
>
> _______________________________________________
> LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
> Send requests to lvs-users-request [at] LinuxVirtualServer
> or go to http://lists.graemef.net/mailman/listinfo/lvs-users
>
_______________________________________________
LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
Send requests to lvs-users-request [at] LinuxVirtualServer
or go to http://lists.graemef.net/mailman/listinfo/lvs-users


graeme at graemef

Feb 13, 2008, 12:04 PM

Post #6 of 12 (702 views)
Permalink
Re: [lvs-users] load balancing works... kinda [In reply to]

On Wed, 2008-02-13 at 14:51 -0500, Charlie Williams wrote:
> that worked for the local server, then I attempted to setup a 3rd machine
> solely running an apache server, ldirectord is able to reach its test page,
> and indicates that the server is available, but requests are not getting
> through from the virtual ip to the apache server (I see no accesses in the
> apache log from anything other than ldirectord), I don't see any indication
> of errors. Should I even be using direct routing? Would tunneling be a
> better scalable solution anyway?

Probably not, for a "local" networking setup (by which I mean all on the
same backend subnet, or L2 collision domain).

Does your third server have the VIP on a loopback (or other) alias?
ldirectord queries the RIP for healthchecks, as I recall.

Graeme


_______________________________________________
LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
Send requests to lvs-users-request [at] LinuxVirtualServer
or go to http://lists.graemef.net/mailman/listinfo/lvs-users


cwilliams.work at gmail

Feb 13, 2008, 12:07 PM

Post #7 of 12 (694 views)
Permalink
Re: [lvs-users] load balancing works... kinda [In reply to]

yes I setup the 3rd machine with all the same interfaces as the first two,
the loopback for the vip is there.

On Feb 13, 2008 3:04 PM, Graeme Fowler <graeme [at] graemef> wrote:

> On Wed, 2008-02-13 at 14:51 -0500, Charlie Williams wrote:
> > that worked for the local server, then I attempted to setup a 3rd
> machine
> > solely running an apache server, ldirectord is able to reach its test
> page,
> > and indicates that the server is available, but requests are not getting
> > through from the virtual ip to the apache server (I see no accesses in
> the
> > apache log from anything other than ldirectord), I don't see any
> indication
> > of errors. Should I even be using direct routing? Would tunneling be a
> > better scalable solution anyway?
>
> Probably not, for a "local" networking setup (by which I mean all on the
> same backend subnet, or L2 collision domain).
>
> Does your third server have the VIP on a loopback (or other) alias?
> ldirectord queries the RIP for healthchecks, as I recall.
>
> Graeme
>
>
> _______________________________________________
> LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
> Send requests to lvs-users-request [at] LinuxVirtualServer
> or go to http://lists.graemef.net/mailman/listinfo/lvs-users
>
_______________________________________________
LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
Send requests to lvs-users-request [at] LinuxVirtualServer
or go to http://lists.graemef.net/mailman/listinfo/lvs-users


graeme at graemef

Feb 13, 2008, 12:14 PM

Post #8 of 12 (700 views)
Permalink
Re: [lvs-users] load balancing works... kinda [In reply to]

On Wed, 2008-02-13 at 15:07 -0500, Charlie Williams wrote:
> yes I setup the 3rd machine with all the same interfaces as the first two,
> the loopback for the vip is there.

Time to break out good ole trusty tcpdump, then.

On the 3rd server, assuming eth0 is the interface that the client
requests will arrive on and that $VIP and $RIP are known :) do:

/usr/sbin/tcpdump -qnieth0 host $VIP or host $RIP

Make a client request. See if the traffic arrives, if it gets handled,
whether the machine responds - that sort of thing.

You *should* see:

SYN, ACK, SYN/ACK, RST, FIN (more or less in that order) from the
director to the RIP as ldirectord does its thing.

The same from the client. Although, obviously, you probably won't.

Graeme


_______________________________________________
LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
Send requests to lvs-users-request [at] LinuxVirtualServer
or go to http://lists.graemef.net/mailman/listinfo/lvs-users


cwilliams.work at gmail

Feb 13, 2008, 12:39 PM

Post #9 of 12 (695 views)
Permalink
Re: [lvs-users] load balancing works... kinda [In reply to]

well I think my interfaces are setup wrong, because while trying to test
this command occasionally I was able to hit my original web server (still
running on loadb1) but not actually in the ldirectord.cf file or listing
when I hit ipvsadm -Ln so I think I must have configured the race condition
somehow.

Can you explain which interfaces are supposed to be setup how?

I have a VIP loopback setup on all machines currently and thats obviously
not right ;)

on each machine I have
/etc/sysconfig/network with the gateway set
/etc/sysconfig/network-scripts/ifcfg-lo:0 with the virtual ip configured
/etc/sysconfig/network-scripts/ifcfg-eth0 with the real ip and gateway set

-Charlie

On Feb 13, 2008 3:14 PM, Graeme Fowler <graeme [at] graemef> wrote:

> On Wed, 2008-02-13 at 15:07 -0500, Charlie Williams wrote:
> > yes I setup the 3rd machine with all the same interfaces as the first
> two,
> > the loopback for the vip is there.
>
> Time to break out good ole trusty tcpdump, then.
>
> On the 3rd server, assuming eth0 is the interface that the client
> requests will arrive on and that $VIP and $RIP are known :) do:
>
> /usr/sbin/tcpdump -qnieth0 host $VIP or host $RIP
>
> Make a client request. See if the traffic arrives, if it gets handled,
> whether the machine responds - that sort of thing.
>
> You *should* see:
>
> SYN, ACK, SYN/ACK, RST, FIN (more or less in that order) from the
> director to the RIP as ldirectord does its thing.
>
> The same from the client. Although, obviously, you probably won't.
>
> Graeme
>
>
> _______________________________________________
> LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
> Send requests to lvs-users-request [at] LinuxVirtualServer
> or go to http://lists.graemef.net/mailman/listinfo/lvs-users
>
_______________________________________________
LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
Send requests to lvs-users-request [at] LinuxVirtualServer
or go to http://lists.graemef.net/mailman/listinfo/lvs-users


cwilliams.work at gmail

Feb 13, 2008, 1:13 PM

Post #10 of 12 (696 views)
Permalink
Re: [lvs-users] load balancing works... kinda [In reply to]

so probably not news to anyone that the problem was me having stared at this
and a bazillion terminal windows for way too long today. In the lo interface
of the 3rd machine I had a loopback set to the rip and not the vip thanks
for all your help.

On Feb 13, 2008 3:39 PM, Charlie Williams <cwilliams.work [at] gmail> wrote:

> well I think my interfaces are setup wrong, because while trying to test
> this command occasionally I was able to hit my original web server (still
> running on loadb1) but not actually in the ldirectord.cf file or listing
> when I hit ipvsadm -Ln so I think I must have configured the race condition
> somehow.
>
> Can you explain which interfaces are supposed to be setup how?
>
> I have a VIP loopback setup on all machines currently and thats obviously
> not right ;)
>
> on each machine I have
> /etc/sysconfig/network with the gateway set
> /etc/sysconfig/network-scripts/ifcfg-lo:0 with the virtual ip configured
> /etc/sysconfig/network-scripts/ifcfg-eth0 with the real ip and gateway set
>
> -Charlie
>
>
> On Feb 13, 2008 3:14 PM, Graeme Fowler <graeme [at] graemef> wrote:
>
> > On Wed, 2008-02-13 at 15:07 -0500, Charlie Williams wrote:
> > > yes I setup the 3rd machine with all the same interfaces as the first
> > two,
> > > the loopback for the vip is there.
> >
> > Time to break out good ole trusty tcpdump, then.
> >
> > On the 3rd server, assuming eth0 is the interface that the client
> > requests will arrive on and that $VIP and $RIP are known :) do:
> >
> > /usr/sbin/tcpdump -qnieth0 host $VIP or host $RIP
> >
> > Make a client request. See if the traffic arrives, if it gets handled,
> > whether the machine responds - that sort of thing.
> >
> > You *should* see:
> >
> > SYN, ACK, SYN/ACK, RST, FIN (more or less in that order) from the
> > director to the RIP as ldirectord does its thing.
> >
> > The same from the client. Although, obviously, you probably won't.
> >
> > Graeme
> >
> >
> > _______________________________________________
> > LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
> > Send requests to lvs-users-request [at] LinuxVirtualServer
> > or go to http://lists.graemef.net/mailman/listinfo/lvs-users
> >
>
>
_______________________________________________
LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
Send requests to lvs-users-request [at] LinuxVirtualServer
or go to http://lists.graemef.net/mailman/listinfo/lvs-users


graeme at graemef

Feb 13, 2008, 1:17 PM

Post #11 of 12 (696 views)
Permalink
Re: [lvs-users] load balancing works... kinda [In reply to]

On Wed, 2008-02-13 at 16:13 -0500, Charlie Williams wrote:
> so probably not news to anyone that the problem was me

Glad to hear you solved it. Does it now work as you expect?

Graeme


_______________________________________________
LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
Send requests to lvs-users-request [at] LinuxVirtualServer
or go to http://lists.graemef.net/mailman/listinfo/lvs-users


cwilliams.work at gmail

Feb 13, 2008, 1:21 PM

Post #12 of 12 (702 views)
Permalink
Re: [lvs-users] load balancing works... kinda [In reply to]

yep seems to be working fine now. My next step is probably going to be to
attempt to update heartbeat with version 2 for the crm module and begin
playing with those bells and whistles. I'd like to also find some
documentation on all the configuration files, since there seem to be plenty
of tutorials showing what to put in there, but no real descriptions of what
all the options are.

-Charlie

On Feb 13, 2008 4:17 PM, Graeme Fowler <graeme [at] graemef> wrote:

> On Wed, 2008-02-13 at 16:13 -0500, Charlie Williams wrote:
> > so probably not news to anyone that the problem was me
>
> Glad to hear you solved it. Does it now work as you expect?
>
> Graeme
>
>
> _______________________________________________
> LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
> Send requests to lvs-users-request [at] LinuxVirtualServer
> or go to http://lists.graemef.net/mailman/listinfo/lvs-users
>
_______________________________________________
LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
Send requests to lvs-users-request [at] LinuxVirtualServer
or go to http://lists.graemef.net/mailman/listinfo/lvs-users

Linux Virtual Server users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.