I really have no idea...
I have a java web application which stores the session id in URL rather than using cookies. I want to run the application on 2 tomcat servers and fronting them with an Apache server for load balancing.
__ tomcat1
Apache ----/
\__ tomcat2
By setting the jvmRoute
to tomcat1
in the Tomcat server.xml
file, the url will become http://url;jsessionid=id.tomcat1
. So it is possible to achieve session stickyness by looking at the url, and route it to the corresponding server.
I know that mod_proxy
and mod_jk
and do the load balancing, but their sticky session only work when the session id is stored in cookies. In my case, the session id is encoded in the URL. How can I do the load balancing?
Maybe your configuration is wrong. Documentation is not specified sticky-session working only cookies.
So you can specify the sessionid like below.
Hope this helps.
For creating the sticky we need to add the following line in your configuration(mod_proxy)
Then specify the route name in the config
And add these routenames to tcserver.node in catalina.properties of tomcat servers