Hongqing Liu | fd5ee81 | 2014-05-10 16:32:51 +0800 | [diff] [blame^] | 1 | <html><head><META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>Apache Tomcat Configuration Reference (6.0.39) - The Cluster Valve object</title><meta name="author" content="Filip Hanik"><style type="text/css" media="print">
|
| 2 | .noPrint {display: none;}
|
| 3 | td#mainBody {width: 100%;}
|
| 4 | </style></head><body bgcolor="#ffffff" text="#000000" link="#525D76" alink="#525D76" vlink="#525D76"><table border="0" width="100%" cellspacing="0"><!--PAGE HEADER--><tr><td><!--PROJECT LOGO--><a href="http://tomcat.apache.org/"><img src="../images/tomcat.gif" align="right" alt="
|
| 5 | The Apache Tomcat Servlet/JSP Container
|
| 6 | " border="0"></a></td><td><h1><font face="arial,helvetica,sanserif">Apache Tomcat 6.0</font></h1><font face="arial,helvetica,sanserif">Version 6.0.39, Jan 27 2014</font></td><td><!--APACHE LOGO--><a href="http://www.apache.org/"><img src="../images/asf-logo.gif" align="right" alt="Apache Logo" border="0"></a></td></tr></table><table border="0" width="100%" cellspacing="4"><!--HEADER SEPARATOR--><tr><td colspan="2"><hr noshade="noshade" size="1"></td></tr><tr><!--LEFT SIDE NAVIGATION--><td width="20%" valign="top" nowrap="nowrap" class="noPrint"><p><strong>Links</strong></p><ul><li><a href="../index.html">Docs Home</a></li><li><a href="index.html">Config Ref. Home</a></li></ul><p><strong>Top Level Elements</strong></p><ul><li><a href="server.html">Server</a></li><li><a href="service.html">Service</a></li></ul><p><strong>Executors</strong></p><ul><li><a href="executor.html">Executor</a></li></ul><p><strong>Connectors</strong></p><ul><li><a href="http.html">HTTP</a></li><li><a href="ajp.html">AJP</a></li></ul><p><strong>Containers</strong></p><ul><li><a href="context.html">Context</a></li><li><a href="engine.html">Engine</a></li><li><a href="host.html">Host</a></li><li><a href="cluster.html">Cluster</a></li></ul><p><strong>Nested Components</strong></p><ul><li><a href="globalresources.html">Global Resources</a></li><li><a href="listeners.html">Listeners</a></li><li><a href="loader.html">Loader</a></li><li><a href="manager.html">Manager</a></li><li><a href="realm.html">Realm</a></li><li><a href="resources.html">Resources</a></li><li><a href="valve.html">Valve</a></li></ul><p><strong>Cluster Elements</strong></p><ul><li><a href="cluster.html">Cluster</a></li><li><a href="cluster-manager.html">Manager</a></li><li><a href="cluster-channel.html">Channel</a></li><li><a href="cluster-membership.html">Channel/Membership</a></li><li><a href="cluster-sender.html">Channel/Sender</a></li><li><a href="cluster-receiver.html">Channel/Receiver</a></li><li><a href="cluster-interceptor.html">Channel/Interceptor</a></li><li><a href="cluster-valve.html">Valve</a></li><li><a href="cluster-deployer.html">Deployer</a></li><li><a href="cluster-listener.html">ClusterListener</a></li></ul><p><strong>Other</strong></p><ul><li><a href="filter.html">Filter</a></li><li><a href="systemprops.html">System properties</a></li></ul></td><!--RIGHT SIDE MAIN BODY--><td width="80%" valign="top" align="left" id="mainBody"><h1>Apache Tomcat Configuration Reference</h1><h2>The Cluster Valve object</h2><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Table of Contents"><!--()--></a><a name="Table_of_Contents"><strong>Table of Contents</strong></a></font></td></tr><tr><td><blockquote>
|
| 7 | <ul><li><a href="#Introduction">Introduction</a></li><li><a href="#org.apache.catalina.ha.tcp.ReplicationValve">org.apache.catalina.ha.tcp.ReplicationValve</a><ol><li><a href="#org.apache.catalina.ha.tcp.ReplicationValve/Attributes">Attributes</a></li></ol></li><li><a href="#org.apache.catalina.ha.session.JvmRouteBinderValve">org.apache.catalina.ha.session.JvmRouteBinderValve</a><ol><li><a href="#org.apache.catalina.ha.session.JvmRouteBinderValve/Attributes">Attributes</a></li></ol></li></ul>
|
| 8 | </blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Introduction"><strong>Introduction</strong></a></font></td></tr><tr><td><blockquote>
|
| 9 | <p>
|
| 10 | A cluster valve is no different from any other <a href="valve.html">Tomcat <code>Valve</code></a>.
|
| 11 | The cluster valves are interceptors in the invocation chain for HTTP requests, and the clustering implementation
|
| 12 | uses these valves to make intelligent decision around data and when data should be replicated.
|
| 13 | </p>
|
| 14 | <p>
|
| 15 | A cluster valve must implement the <code>org.apache.catalina.ha.ClusterValve</code> interface.
|
| 16 | This is a simple interface that extends the <code>org.apache.catalina.Valve</code> interface.
|
| 17 | </p>
|
| 18 | </blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="org.apache.catalina.ha.tcp.ReplicationValve"><strong>org.apache.catalina.ha.tcp.ReplicationValve</strong></a></font></td></tr><tr><td><blockquote>
|
| 19 | The <code>ReplicationValve</code> will notify the cluster at the end of a HTTP request
|
| 20 | so that the cluster can make a decision whether there is data to be replicated or not.
|
| 21 | <table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="org.apache.catalina.ha.tcp.ReplicationValve/Attributes"><strong>Attributes</strong></a></font></td></tr><tr><td><blockquote>
|
| 22 | <table border="1" cellpadding="5"><tr><th width="15%" bgcolor="#023264"><font color="#ffffff">Attribute</font></th><th width="85%" bgcolor="#023264"><font color="#ffffff">Description</font></th></tr><tr><td align="left" valign="center"><strong><code>className</code></strong></td><td align="left" valign="center">
|
| 23 | Set value to <code>org.apache.catalina.ha.tcp.ReplicationValve</code>
|
| 24 | </td></tr><tr><td align="left" valign="center"><code>filter</code></td><td align="left" valign="center">
|
| 25 | For known file extensions or urls, you can use a filter to
|
| 26 | notify the cluster that the session has not been modified during this
|
| 27 | request and the cluster doesn't have to probe the session managers for changes.
|
| 28 | If there is a filter match, the cluster assumes there has been no session change.
|
| 29 | An example filter would look like <code>filter=".*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;"</code>
|
| 30 | The filter uses regular expressions and each filter is delimited by a semi colon.
|
| 31 | <code>Pattern#compile(java.lang.String)</code>
|
| 32 | </td></tr><tr><td align="left" valign="center"><code>primaryIndicator</code></td><td align="left" valign="center">
|
| 33 | Boolean value, so to true, and the replication valve will insert a request attribute with the name
|
| 34 | defined by the <code>primaryIndicatorName</code> attribute.
|
| 35 | The value inserted into the request attribute is either <code>Boolean.TRUE</code> or
|
| 36 | <code>Boolean.FALSE</code>
|
| 37 | </td></tr><tr><td align="left" valign="center"><code>primaryIndicatorName</code></td><td align="left" valign="center">
|
| 38 | Default value is <code>org.apache.catalina.ha.tcp.isPrimarySession</code>
|
| 39 | The value defined here is the name of the request attribute that contains the boolean value
|
| 40 | if the session is primary on this server or not.
|
| 41 | </td></tr><tr><td align="left" valign="center"><code>statistics</code></td><td align="left" valign="center">
|
| 42 | Boolean value. Set to <code>true</code> if you want the valve to collect request statistics.
|
| 43 | Default value is <code>false</code>
|
| 44 | </td></tr></table>
|
| 45 | </blockquote></td></tr></table>
|
| 46 | </blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="org.apache.catalina.ha.session.JvmRouteBinderValve"><strong>org.apache.catalina.ha.session.JvmRouteBinderValve</strong></a></font></td></tr><tr><td><blockquote>
|
| 47 | In case of a mod_jk failover, the <code>JvmRouteBinderValve</code> will replace the
|
| 48 | <code>jvmWorker</code> attribute in the session Id, to make future requests stick to this
|
| 49 | node. If you want failback capability, don't enable this valve, but if you want your failover to stick,
|
| 50 | and for mod_jk not to have to keep probing the node that went down, you use this valve.
|
| 51 | <table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="org.apache.catalina.ha.session.JvmRouteBinderValve/Attributes"><strong>Attributes</strong></a></font></td></tr><tr><td><blockquote>
|
| 52 | <table border="1" cellpadding="5"><tr><th width="15%" bgcolor="#023264"><font color="#ffffff">Attribute</font></th><th width="85%" bgcolor="#023264"><font color="#ffffff">Description</font></th></tr><tr><td align="left" valign="center"><strong><code>className</code></strong></td><td align="left" valign="center">
|
| 53 | <code>org.apache.catalina.ha.session.JvmRouteBinderValve</code>
|
| 54 | </td></tr><tr><td align="left" valign="center"><code>enabled</code></td><td align="left" valign="center">
|
| 55 | Default value is <code>true</code>
|
| 56 | Runtime attribute to turn on and off turn over of the session's jvmRoute value.
|
| 57 | </td></tr></table>
|
| 58 | </blockquote></td></tr></table>
|
| 59 | </blockquote></td></tr></table></td></tr><!--FOOTER SEPARATOR--><tr><td colspan="2"><hr noshade="noshade" size="1"></td></tr><!--PAGE FOOTER--><tr><td colspan="2"><div align="center"><font color="#525D76" size="-1"><em>
|
| 60 | Copyright © 1999-2014, Apache Software Foundation
|
| 61 | </em></font></div></td></tr></table></body></html> |