Sticky Sessions in JBoss

In update lb worker:


On a UNIX system add to jk.conf:

JkShmFile logs/jk.shm

In each Tomcats' server.xml set: <Engine ... jvmRoute="jboss1"> (or jboss2)

Interested in mastering JBOSS?

Learn more about JBOSS Tutorial in this blog post.

After restarting, test with two browsers

Directive sticky_session is set to 1 (or True) by default, but we turn it on to make it explicit.

Enabling the shared memory file (JkShmFile) is not required, but allows the HTTPD processes to better communicate on a prefork-type system.

The value of the jvmRoute attribute in server.xml`s `<Engine> must match the name of the worker instance as configured in the file.

For indepth understanding on JBoss click on: