3 Replies Latest reply on May 21, 2003 9:30 AM by Robert Costanzo

    Load Balancing on JBoss 3.2.1 with Jetty and JK Module

    Robert Costanzo Newbie

      Has anybody gotten the JK Module (JK1 or JK2) to work properly with Jetty/JBoss in a clustered environment? I have tried both the JK1 and JK2 modules, and I cannot get either of them to load balance sessions properly. When one of my servers goes down, the session is properly failed over to another server. However, new sessions are always created on the first server in my worker list.

      I know there is a Tomcat specific setting needed to get the JK modules to work (with regards to the JVM route). Is there the equivalent for Jetty which I'm missing?

      I am running Apache 1.3.27 on Linux with JBoss 3.2.1. I have included my worker.properties for the JK1 module below:

      worker.list=srv1, srv2, loadbalancer

      # Define the first srv...

      # ...and the second srv.

      # Now we define the load-balancing behavior

        • 1. Re: Load Balancing on JBoss 3.2.1 with Jetty and JK Module
          Dennis Cartier Newbie


          You can get JK1 to load balance properly if you set 'local_worker=0' in your config for each server as displayed above. For some reason (which I have never comprehended) when there are servers marked as local, it always selects the first one in the properties file to send all new sessions to.

          I use this idiosyncrasy to direct ALL new sessions to 1 node when I want to take servers out of the pool by marking 1 node as local and restarting Apache.

          Just for the record, this has nothing to do with JBoss or Jetty.


          • 2. Re: Load Balancing on JBoss 3.2.1 with Jetty and JK Module
            Sacha Labourey Master

            Please try by changing this:

            worker.list=srv1, srv2, loadbalancer

            to this:




            • 3. Re: Load Balancing on JBoss 3.2.1 with Jetty and JK Module
              Robert Costanzo Newbie

              I've made both of the suggested changes and my sessions are now created properly on each server. I agree that the local worker setting is buggy since it only assumes that only a single worker will ever be local.

              However, I'm now having an issue with regards to sticky sessions. A single user's session gets bounced back and forth between my two appservers. The session itself is being properly replicated (using Jetty's JGStore), so my application is functioning. However, not having sticky sessions is bad for performance due to the cache misses. Again, I'm using the JK module with Apache 1.3.27 and Jetty. Has anyone gotten sticky sessions to work with the JK module and Jetty? Are there any additional configurations which I'm missing?