HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Server Operation (http://www.howtoforge.com/forums/forumdisplay.php?f=5)
-   -   High Availabilty with heartbeat and ldirectord (http://www.howtoforge.com/forums/showthread.php?t=4905)

tate_harmann 14th June 2006 23:49

High Availabilty with heartbeat and ldirectord
 
Hello,
I am setting up a highly available, load balancing apache cluster. I think I have everything in place, and everything works except the load balancing. Heartbeat is used for the failover and works fine. I am using source hashing as the scheduling-method for ldirectord. Ldirectord does see the two nodes as the out put of "ipvsadm -L -n" shows:
SLES9-CLUSTER1:~ # ipvsadm -L -n
IP Virtual Server version 1.2.0 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 192.168.200.79:80 sh
-> 192.168.200.78:80 Route 1 0 0
-> 192.168.200.77:80 Local 1 0 0

And when I shut down one of the boxes, they are pulled from the pool and the master will roll to the other like it is supposed to. However, the actual web request on port 80 fails when going to the non-local node (192.168.200.78 in the above example.) It will come through fine on the local node. So about half of the web requests fail. I did enable ip forwarding, is there anything else I need to do? Oh, it is suse enterprise linux 9, and the service address gets bound to eth0 as eth0:0. I don't know if this is right, but most of the examples I found online set up the service address as lo:0.
I can post some config files if needed.

thank you,

tate_harmann 15th June 2006 03:31

I guess I just modified the config found here:
http://www.howtoforge.org/high_avail...apache_cluster

All I need is step 6, everything else works. However, I did mine with only two boxes instead of four. Each has a loadbalancer and http service on it. Only one loadbalancer is active at a time, but I still want both boxes to balance the http requests. There is an article I found on doing this very setup:
http://www.ultramonkey.org/2.0.1/top...-ha-lb-eg.html

However, I needed to tweak mine a little as I am running SLES 9. I am basically using a hybrid config between the two tutorials.

thanks,

noahlau 15th June 2006 09:35

Quote:

Originally Posted by tate_harmann
I guess I just modified the config found here:
http://www.howtoforge.org/high_avail...apache_cluster

All I need is step 6, everything else works. However, I did mine with only two boxes instead of four. Each has a loadbalancer and http service on it. Only one loadbalancer is active at a time, but I still want both boxes to balance the http requests. There is an article I found on doing this very setup:
http://www.ultramonkey.org/2.0.1/top...-ha-lb-eg.html

However, I needed to tweak mine a little as I am running SLES 9. I am basically using a hybrid config between the two tutorials.

thanks,

In HA cluster, Only one loadbalancer is active at a time. The another one is standby load balancer which will be active when the primary loadbalancer is failed.

falko 15th June 2006 15:54

Quote:

Originally Posted by tate_harmann
However, the actual web request on port 80 fails when going to the non-local node (192.168.200.78 in the above example.) It will come through fine on the local node.

I only see local IP addresses in your post... :confused:

tate_harmann 15th June 2006 17:30

Sorry, what I mean is the output of the "ipvsadm -L -n" command lists the nodes as local or route:
TCP 192.168.200.79:80 sh
-> 192.168.200.78:80 Route 1 0 0
-> 192.168.200.77:80 Local 1 0 0

They are all private ip addresses. 192.168.200.79 is my virtual address, .77 is the active load balancer but is also an available node to recieve http requests. .78 is the other node, but I'm not sure that the loadbalancer is passing requests to that node or not. Since half of my requests were failing, I assumed the ones that failed were the ones getting forwarded to .78 and then getting dropped.

tate_harmann 15th June 2006 18:13

OK, I think I found my problem here:
The Linux Virtual Server has three different ways of forwarding packets: Network Address Translation (NAT), IP-IP encapsulation or tunnelling and Direct Routing.

* Direct Routing: Packets from end users are forwarded directly to the real server. The IP packet is not modified, so the real servers must be configured to accept traffic for the virtual server's IP address. This can be done using a dummy interface, or packet filtering to redirect traffic addressed to the virtual server's IP address to a local port. The real server may send replies directly back to the end user. That is if a host based layer 4 switch is used, it may not be in the return path.

I need to set up an ip alias on my loopback (lo:0) for the apache web server to accept connections for the virtual ip address (192.168.200.79). However, the tutorial explains how to do it in debian, do you know how it is done on SLES 9? I'll check in the meantime. Thanks,

tate_harmann 15th June 2006 18:50

Yes,
That was the problem. I just did:

ifconfig lo:0 192.168.200.79 255.255.255.255

to add the alias, and the server started accepting requests.

thanks,

_stephan_ 26th August 2007 22:11

Hi there!

So, i did like the howto described, but when i nmap the VIP, the http and mysql port is filtered.. Is there anything else i have to do? e.g. change the default route or add a new route on the realservers?

Thanks!

_stephan_ 28th August 2007 18:59

No ideas?

hm, i thought it would be easier to get some hints...

greets

falko 29th August 2007 18:48

Quote:

Originally Posted by _stephan_
Hi there!

So, i did like the howto described, but when i nmap the VIP, the http and mysql port is filtered..

What do you mean with "filtered"?


All times are GMT +2. The time now is 17:08.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.