Forum Moderators: phranque

Message Too Old, No Replies

Apache HTTP Server 2.2.17 as load balancer

         

roi_ze

1:38 pm on Nov 4, 2010 (gmt 0)

10+ Year Member



Hi erveryone,
I'm very new to this and have no background in the subject. I need help configuring a load balancer.

I am using Tomcat 6 as the application server for my application. The configuration I'm trying to achieve consists of two servers.

Server1 has Apache 2.2, Tomcat 6 and the application installed
Server2 has Tomcat 6, the application and the DB used by the application on both servers installed.

I want Apache to serve as a load balancer so that when the application installed on server1 is being used by user1, Apache will redirect user2 to the application on server2.

Can anyone help me achieve this with an explanation 'for dummies'?

Thanks

sublime1

2:52 pm on Nov 4, 2010 (gmt 0)

10+ Year Member



Hi roi_ze --

I have done something like what you have described using Tomcat in a configuration similar to what you describe.

The short answer is that you need to set up Apache as a "reverse proxy" using the mod_proxy, and mod_proxy_balancer, and you can find all sorts of juicy doc at [httpd.apache.org...] and probably more at the Tomcat site.

That said, you might want to have Tomcat serve all of your content including static content like images, css, js and the like. If so you may be better off using software designed just to be a load balancer. I eventually went this direction and never looked back -- this means all the configuration and content can be managed in one place.

The load balancing software I used was HAProxy -- free, lightweight, configurable and a fantastic bit of software.

Tom

roi_ze

3:35 pm on Nov 4, 2010 (gmt 0)

10+ Year Member



Thank you very much for your reply.
I read about mod_proxy and mod_proxy_balancer but I also found some information about mod_jk and workers.properties configuration. Should mod_jk be used for load balancing or mod_proxy_balancer is the way to go?
Also, I will be looking into HAProxy in the next couple of days and see what it's all about. As I said in my previous post, I lack the background to understand what you mean by serving static content so I'm not sure it's what I need.

EDIT: Is HAProxy compatible with Windows? I forgot to mention that I am using Windows on all my machines.

Thanks again