Author: kkolinko Date: Wed Jul 22 00:49:47 2009 New Revision: 796592 URL: http://svn.apache.org/viewvc?rev=796592&view=rev Log: Rewrite (reword) the Javadoc comment for JvmRouteBinderValve class. It is backport of rev.795458 from 6.0
Modified: tomcat/container/tc5.5.x/modules/cluster/src/share/org/apache/catalina/cluster/session/JvmRouteBinderValve.java Modified: tomcat/container/tc5.5.x/modules/cluster/src/share/org/apache/catalina/cluster/session/JvmRouteBinderValve.java URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/cluster/src/share/org/apache/catalina/cluster/session/JvmRouteBinderValve.java?rev=796592&r1=796591&r2=796592&view=diff ============================================================================== --- tomcat/container/tc5.5.x/modules/cluster/src/share/org/apache/catalina/cluster/session/JvmRouteBinderValve.java (original) +++ tomcat/container/tc5.5.x/modules/cluster/src/share/org/apache/catalina/cluster/session/JvmRouteBinderValve.java Wed Jul 22 00:49:47 2009 @@ -45,41 +45,52 @@ /** * 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 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! - * As jsessionid was created by cookie, the change JSESSIONID cookie resend with next response. - * - * At all cluster node you must configure the as ClusterListener since 5.5.10 - * {...@link org.apache.catalina.cluster.session.JvmRouteSessionIDBinderListener JvmRouteSessionIDBinderListener} - * or before with - * org.apache.catalina.cluster.session.JvmRouteSessionIDBinderListenerLifecycle. + * failure. After a node crashes, subsequent requests go to other cluster nodes. + * That incurs a drop in performance. When this Valve is enabled on a backup + * node and sees a request, which was intended for another (thus failed) node, + * it will rewrite the cookie jsessionid information to use the route to this + * backup cluster node, that answered the request. After the response is + * delivered to the client, all subsequent client requests will go directly to + * the backup node. The change of sessionid is also sent to all other cluster + * nodes. After all that, the session stickyness will work directly to the + * backup node and the traffic will not go back to the failed node after it is + * restarted! * + * <p> + * For this valve to function correctly, so that all nodes of the cluster + * receive the sessionid change notifications that it generates, the following + * ClusterListener MUST be configured at all nodes of the cluster: + * {...@link org.apache.catalina.cluster.session.JvmRouteSessionIDBinderListener + * JvmRouteSessionIDBinderListener} since Tomcat 5.5.10, and both + * JvmRouteSessionIDBinderListener and JvmRouteSessionIDBinderLifecycleListener + * for earlier versions of Tomcat. + * + * <p> * Add this Valve to your host definition at conf/server.xml . * * Since 5.5.10 as direct cluster valve:<br/> + * * <pre> * <Cluster> * <Valve className="org.apache.catalina.cluster.session.JvmRouteBinderValve" /> * </Cluster> * </pre> + * * <br /> * Before 5.5.10 as Host element:<br/> + * * <pre> - * <Hostr> + * <Host> * <Valve className="org.apache.catalina.cluster.session.JvmRouteBinderValve" /> - * </Hostr> + * </Host> * </pre> * - * Trick:<br/> - * 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. + * <em>A Trick:</em><br/> + * 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 sessions are migrated. * * @author Peter Rossbach * @version $Revision$ $Date$ --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org