Valve to handle Tomcat jvmRoute takeover using mod_jk module after node failure. After a node crashed the next request going to other cluster node. Now the answering from apache is slower ( make some error handshaking. Very bad with apache at my windows.). We rewrite now the cookie jsessionid information to the backup cluster node. After the next response all client request goes direct to the backup node. The change sessionid send also to all other cluster nodes. Well, now the session stickyness work directly to the backup node and traffic don't go back too restarted cluster nodes! At all cluster node you must configure the as ClusterListener since 5.5.10 {@link org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener JvmRouteSessionIDBinderListener}or before with org.apache.catalina.ha.session.JvmRouteSessionIDBinderListenerLifecycle. Add this Valve to your host definition at conf/server.xml . Since 5.5.10 as direct cluster valve:
<Cluster> <Valve className="org.apache.catalina.ha.session.JvmRouteBinderValve" /> </Cluster>
Before 5.5.10 as Host element:
<Hostr> <Valve className="org.apache.catalina.ha.session.JvmRouteBinderValve" /> </Hostr>
Trick:
You can enable this mod_jk turnover mode via JMX before you drop a node to all backup nodes! Set enable true on all JvmRouteBinderValve backups, disable worker at mod_jk and then drop node and restart it! Then enable mod_jk Worker and disable JvmRouteBinderValves again. This use case means that only requested session are migrated.
@author Peter Rossbach
@version $Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (Tue, 24 Oct 2006) $