How to replicate apache mod_jk session data

apache-2.2failoverhigh-availabilitymod-jksticky-sessions

is it possible to replicate the mod_jk sticky session information to another apache for an failover setup?

the idea behind the question is to setup two apaches with sticky sessions in front off some tomcats. when one apaches fails, the other one should take over the mod_jk session information so he knows which requests to serve to what tomcat.

i know an alternative would be session replication at the tomcat level and not to use sticky sessions, but this is not possible at the moment.

Best Answer

If your backend servers (tomcat) are clustered, they should replicate sessions too. In the event of an http failure, connections to 1 http node should go to another node. The jsessionid parameter should give the http / mod_jk enough info to know which node to route to (e.g. jsessionid=lkj234lkj2ljk234lj.jvmRoute1 will tell mod_jk that this session is due for the worker with name jvmRoute1). In the event that the specified worker is unavailable, mod_jk should route to the next worker, which should retrieve the sesison from the cache.

i.e. replication is not needed between httpd servers, as the client-side cookie or URL containing jsessionid contains the routing information.

Related Topic