Load Balancing Jboss with Apache and mod_jk

Apache’s mod_jk has nice load balancing features. They work quite well for me with Jboss. The basic configuration is to install Jboss on several machines and have an Apache to load balance them.

But while the load balancing is good, the Apache machine becomes a single point of failure. I was asked how to overcome that. The main principle I want keep is the “keep it simple, stupid” principle.

Doing a round robin DNS between two machines is nice, but doesn’t really provides real the load balancing (as it always does 50/50). It also doesn’t check for the the load before it does the balancing.

Other options like using mod_backhand and mod_proxy_balancer all leave me with the same single point of failure problem. That’s why I prefer to use an active/passive cluster to make sure Apache can move to another server in case of a failure. The IP address the users get is a virtual (or floating) IP, which can “jump” between the cluster nodes.

There are several ways to create that cluster, but that’s probably for another more general post.

I’ll be happy to hear other opinions…

5 Comments

Filed under Free software applications

5 responses to “Load Balancing Jboss with Apache and mod_jk

  1. We use keepalived at the large fortune 500 company I work for in places not critical enough to use hardware load balancers. It is stupid simple and just plain works. It is great to ssh to box1, force a failover and the next box in the cluster with the highest priority takes over. Then ssh freaks out because the key changed midsession and disconnects you.

    Keepalived was meant to be ran with the whole LVS suite, but we only use it by itsself and it runs like a champ. Seriously good software.

    http://www.keepalived.org

  2. Email me in private for more details if you want.

  3. Pingback: Why using Apache and mod_jk to redirect ports to Jboss/Tomcat ? « Free Software, the Universe and Everything

  4. Karim

    I’ve found a great tutorial on how to set up JBoss load balancing with Apache2’s mod_jk:
    http://www.tritux.com/blog/2010/10/23/load-balancing-jboss-and-apache2-mod_jk/8/1

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s