I am unable to get sticky sessions working with jk and JBoss 3.2.4RC2.
I'm running Apache 2.0.49 on SuSE 9.1. I have jk working fine with a single JBoss backend but sticky sessions are not working when I load balance between multiple jboss backends. I've got JBoss running "out of the box" with a simple .jsp with a counter that uses sessions. Even with sticky_session=1 set in my jk .properties file, it still rotates between all the app servers.
My httpd.conf entry looks like:
LoadModule jk_module /usr/lib/apache2/mod_jk.so
JKWorkersFile /etc/apache2/vhosts.d/test.properties
JkLogFile /var/log/apache2/mod_jk.log
JkLogLevel debug
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat "%w %V %T"
JkMount /* router
My jk .properties file looks like:
worker.list=router, sharkbait, jellyman, littleblue
worker.sharkbait.type=ajp13
worker.sharkbait.host=sharkbait
worker.sharkbait.port=8009
worker.sharkbait.lbfactor=1
worker.sharkbait.cachesize=10
worker.sharkbait.socket_timeout=300
worker.jellyman.type=ajp13
worker.jellyman.host=jellyman
worker.jellyman.port=8009
worker.jellyman.lbfactor=1
worker.jellyman.cachesize=10
worker.jellyman.socket_timeout=300
worker.littleblue.type=ajp13
worker.littleblue.host=littleblue
worker.littleblue.port=8009
worker.littleblue.lbfactor=1
worker.littleblue.cachesize=10
worker.littleblue.socket_timeout=300
worker.router.type=lb
worker.router.balanced_workers=sharkbait, jellyman, littleblue
worker.router.sticky_session=1
Any ideas on why the sessions aren't sticky?
Thanks,
Mike
Yes, I have some idea :-)
You need to set the jvmRoute in JBoss, see http://www.jboss.org/wiki/Wiki.jsp?page=UsingMod_jkWithJBoss (at the end of the page).