Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've tried to implement a high availability service with JBoss and Apache.

The architecture is:

|         |
|         |
JBoss1 JBoss2 

There is a balancer implemented from Apache to the JBoss'es, and it's working fine. Sometimes the request is taken by JBoss1, and sometimes by JBoss2, however if some Jboss goes down, the balancer still sends requests to it, so the application sometimes works and sometimes doesn't.

How can I implement a service which detects that if some JBoss is down, it automatically redirects the traffic to the other node?

I tried with hearbeat, but I can't solve it.

share|improve this question

It is a built-in feature of mod_proxy+mod_proxy_balancer or mod_jk.

They rely on AJP protocol :

Just follow this tutorial.

Here an example of Apache HTTP configuration :

<VirtualHost *:80>

    ServerAlias web-gui-acceptance

    ProxyRequests Off
    ProxyPass /web-gui balancer://jbosscluster/web-gui stickysession=JSESSIONID nofailover=On
    ProxyPassReverse /web-gui
    ProxyPassReverse /web-gui

    <Proxy *>
      AuthType Kerberos

    <Proxy balancer://jbosscluster>
        BalancerMember ajp:// route=SRVLNX01_node1
        BalancerMember ajp:// route=SRVLNX02_node1
        ProxySet lbmethod=byrequests


And for each JBoss instances :

vi $JBOSS_HOME/server/default/deploy/jbossweb.sar/server.xml

<Engine name="jboss.web" defaultHost="localhost" jvmRoute="SRVLNX01_node1">

You can also take a look to HA Proxy

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.