Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 15th June 2006, 00:49
tate_harmann tate_harmann is offline
Junior Member
 
Join Date: Jun 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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,
Reply With Quote
Sponsored Links
  #2  
Old 15th June 2006, 04:31
tate_harmann tate_harmann is offline
Junior Member
 
Join Date: Jun 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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,
Reply With Quote
  #3  
Old 15th June 2006, 10:35
noahlau noahlau is offline
Junior Member
 
Join Date: Mar 2006
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.
Reply With Quote
  #4  
Old 15th June 2006, 16:54
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,747 Times in 2,578 Posts
Default

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...
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 15th June 2006, 18:30
tate_harmann tate_harmann is offline
Junior Member
 
Join Date: Jun 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.
Reply With Quote
  #6  
Old 15th June 2006, 19:13
tate_harmann tate_harmann is offline
Junior Member
 
Join Date: Jun 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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,
Reply With Quote
  #7  
Old 15th June 2006, 19:50
tate_harmann tate_harmann is offline
Junior Member
 
Join Date: Jun 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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,
Reply With Quote
  #8  
Old 26th August 2007, 23:11
_stephan_ _stephan_ is offline
Junior Member
 
Join Date: Aug 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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!

Last edited by _stephan_; 28th August 2007 at 19:58.
Reply With Quote
  #9  
Old 28th August 2007, 19:59
_stephan_ _stephan_ is offline
Junior Member
 
Join Date: Aug 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No ideas?

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

greets
Reply With Quote
  #10  
Old 29th August 2007, 19:48
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,747 Times in 2,578 Posts
 
Default

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"?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 05:40.


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