From: kkolinko Date: Sun, 19 Jul 2009 01:12:50 +0000 (+0000) Subject: Rewrote (reworded) the Javadoc comment for JvmRouteBinderValve class. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=06f71e57c5ad82958e0fb7d1f3dedd6689fe6db8;p=tomcat7.0 Rewrote (reworded) the Javadoc comment for JvmRouteBinderValve class. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@795457 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/ha/session/JvmRouteBinderValve.java b/java/org/apache/catalina/ha/session/JvmRouteBinderValve.java index 6fa39ab6e..83f2dddc3 100644 --- a/java/org/apache/catalina/ha/session/JvmRouteBinderValve.java +++ b/java/org/apache/catalina/ha/session/JvmRouteBinderValve.java @@ -47,40 +47,52 @@ import org.apache.catalina.valves.ValveBase; /** * 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! + * 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! * - * 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. + *

+ * 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.ha.session.JvmRouteSessionIDBinderListener + * JvmRouteSessionIDBinderListener} since Tomcat 5.5.10, and both + * JvmRouteSessionIDBinderListener and JvmRouteSessionIDBinderLifecycleListener + * for earlier versions of Tomcat. * + *

* 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>
+ *  <Host>
  *  <Valve className="org.apache.catalina.ha.session.JvmRouteBinderValve" />  
- *  </Hostr>
+ *  </Host>
  * 
* - * 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. + * A 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 sessions are migrated. * * @author Peter Rossbach * @version $Revision$ $Date$