users@glassfish.java.net

Re: AJP/mod_jk load balancing in a cluster - sticky sessions not so sticky

From: <glassfish_at_javadesktop.org>
Date: Wed, 07 May 2008 04:34:12 PDT

I finally figured it out, so I'm posting this if someone else has the same problem

There are basically 2 issues here :

1. sessions are not sticky - I missed this part in the mod_jk documentation :
"Furthermore the names of the workers which are managed by the balancer have to be equal to the jvmRoute of the Tomcat instance they connect with."
[http://tomcat.apache.org/connectors-doc/generic_howto/loadbalancers.html]
one I made the worker names and the jvmRoute properties the same for each cluster instance that solved the problem.
2. Each request gets a new session id. I read somewhere on a blog that you need to add the <distributable/> tag to your web.xml file, and then when you deploy the app into the cluster, you need to set availibility=true (default is false). This solved the session id issue

I must say it would be nice if everything was documented nicely in on place instead of being spread all over the show, glassfish docs, sjsas docs, glassfish wiki, glassfish forums, people's blogs etc.
[Message sent by forum member 'eduardp' (eduardp)]

http://forums.java.net/jive/thread.jspa?messageID=273116