Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 771 | blopes | 1 | <!DOCTYPE html SYSTEM "about:legacy-compat"> |
| 2 | <html lang="en"><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><link href="../images/docs-stylesheet.css" rel="stylesheet" type="text/css"><title>Apache Tomcat 9 Configuration Reference (9.0.112) - The Cluster Valve object</title></head><body><div id="wrapper"><header><div id="header"><div><div><div class="logo noPrint"><a href="https://tomcat.apache.org/"><img alt="Tomcat Home" src="../images/tomcat.png"></a></div><div style="height: 1px;"></div><div class="asfLogo noPrint"><a href="https://www.apache.org/" target="_blank"><img src="../images/asf-logo.svg" alt="The Apache Software Foundation" style="width: 266px; height: 83px;"></a></div><h1>Apache Tomcat 9 Configuration Reference</h1><div class="versionInfo"> |
||
| 3 | Version 9.0.112, |
||
| 4 | <time datetime="2025-11-06">Nov 6 2025</time></div><div style="height: 1px;"></div><div style="clear: left;"></div></div></div></div></header><div id="middle"><div><div id="mainLeft" class="noprint"><div><nav><div><h2>Links</h2><ul><li><a href="../index.html">Docs Home</a></li><li><a href="index.html">Config Ref. Home</a></li><li><a href="https://cwiki.apache.org/confluence/display/TOMCAT/FAQ">FAQ</a></li><li><a href="#comments_section">User Comments</a></li></ul></div><div><h2>Top Level Elements</h2><ul><li><a href="server.html">Server</a></li><li><a href="service.html">Service</a></li></ul></div><div><h2>Executors</h2><ul><li><a href="executor.html">Executor</a></li></ul></div><div><h2>Connectors</h2><ul><li><a href="http.html">HTTP/1.1</a></li><li><a href="http2.html">HTTP/2</a></li><li><a href="ajp.html">AJP</a></li></ul></div><div><h2>Containers</h2><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></div><div><h2>Nested Components</h2><ul><li><a href="cookie-processor.html">CookieProcessor</a></li><li><a href="credentialhandler.html">CredentialHandler</a></li><li><a href="globalresources.html">Global Resources</a></li><li><a href="jar-scanner.html">JarScanner</a></li><li><a href="jar-scan-filter.html">JarScanFilter</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="sessionidgenerator.html">SessionIdGenerator</a></li><li><a href="valve.html">Valve</a></li></ul></div><div><h2>Cluster Elements</h2><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></div><div><h2>web.xml</h2><ul><li><a href="filter.html">Filter</a></li></ul></div><div><h2>Other</h2><ul><li><a href="runtime-attributes.html">Runtime attributes</a></li><li><a href="systemprops.html">System properties</a></li><li><a href="jaspic.html">JASPIC</a></li></ul></div></nav></div></div><div id="mainRight"><div id="content"><h2>The Cluster Valve object</h2><h3 id="Table_of_Contents">Table of Contents</h3><div class="text"> |
||
| 5 | <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><li><a href="#org.apache.catalina.ha.authenticator.ClusterSingleSignOn">org.apache.catalina.ha.authenticator.ClusterSingleSignOn</a><ol><li><a href="#org.apache.catalina.ha.authenticator.ClusterSingleSignOn/Attributes">Attributes</a></li></ol></li></ul> |
||
| 6 | </div><h3 id="Introduction">Introduction</h3><div class="text"> |
||
| 7 | <p> |
||
| 8 | A cluster valve is no different from any other <a href="valve.html">Tomcat <code>Valve</code></a>. |
||
| 9 | The cluster valves are interceptors in the invocation chain for HTTP requests, and the clustering implementation |
||
| 10 | uses these valves to make intelligent decision around data and when data should be replicated. |
||
| 11 | </p> |
||
| 12 | <p> |
||
| 13 | A cluster valve must implement the <code>org.apache.catalina.ha.ClusterValve</code> interface. |
||
| 14 | This is a simple interface that extends the <code>org.apache.catalina.Valve</code> interface. |
||
| 15 | </p> |
||
| 16 | </div><h3 id="org.apache.catalina.ha.tcp.ReplicationValve">org.apache.catalina.ha.tcp.ReplicationValve</h3><div class="text"> |
||
| 17 | The <code>ReplicationValve</code> will notify the cluster at the end of an HTTP request |
||
| 18 | so that the cluster can make a decision whether there is data to be replicated or not. |
||
| 19 | <div class="subsection"><h4 id="org.apache.catalina.ha.tcp.ReplicationValve/Attributes">Attributes</h4><div class="text"> |
||
| 20 | <table class="defaultTable"><tr><th style="width: 15%;"> |
||
| 21 | Attribute |
||
| 22 | </th><th style="width: 85%;"> |
||
| 23 | Description |
||
| 24 | </th></tr><tr id="org.apache.catalina.ha.tcp.ReplicationValve_Attributes_className"><td><strong><code class="attributeName">className</code></strong></td><td> |
||
| 25 | Set value to <code>org.apache.catalina.ha.tcp.ReplicationValve</code> |
||
| 26 | </td></tr><tr id="org.apache.catalina.ha.tcp.ReplicationValve_Attributes_filter"><td><code class="attributeName">filter</code></td><td> |
||
| 27 | For known file extensions or urls, you can use this Valve to notify the |
||
| 28 | cluster that the session has not been modified during this request and |
||
| 29 | the cluster doesn't have to probe the session managers for changes. If |
||
| 30 | the request matches this filter pattern, the cluster assumes there has |
||
| 31 | been no session change. An example filter would look like <code> |
||
| 32 | filter=".*\.gif|.*\.js|.*\.jpeg|.*\.jpg|.*\.png|.*\.htm|.*\.html|.*\.css|.*\.txt" |
||
| 33 | </code>. The filter is a regular expression using |
||
| 34 | <code>java.util.regex</code>. If no filter pattern specified or if the |
||
| 35 | filter pattern is configured to be the empty string, no filtering will |
||
| 36 | take place. |
||
| 37 | </td></tr><tr id="org.apache.catalina.ha.tcp.ReplicationValve_Attributes_primaryIndicator"><td><code class="attributeName">primaryIndicator</code></td><td> |
||
| 38 | Boolean value, so to true, and the replication valve will insert a request attribute with the name |
||
| 39 | defined by the <code>primaryIndicatorName</code> attribute. |
||
| 40 | The value inserted into the request attribute is either <code>Boolean.TRUE</code> or |
||
| 41 | <code>Boolean.FALSE</code> |
||
| 42 | </td></tr><tr id="org.apache.catalina.ha.tcp.ReplicationValve_Attributes_primaryIndicatorName"><td><code class="attributeName">primaryIndicatorName</code></td><td> |
||
| 43 | Default value is <code>org.apache.catalina.ha.tcp.isPrimarySession</code> |
||
| 44 | The value defined here is the name of the request attribute that contains the boolean value |
||
| 45 | if the session is primary on this server or not. |
||
| 46 | </td></tr><tr id="org.apache.catalina.ha.tcp.ReplicationValve_Attributes_statistics"><td><code class="attributeName">statistics</code></td><td> |
||
| 47 | Boolean value. Set to <code>true</code> if you want the valve to collect request statistics. |
||
| 48 | Default value is <code>false</code> |
||
| 49 | </td></tr></table> |
||
| 50 | </div></div> |
||
| 51 | </div><h3 id="org.apache.catalina.ha.session.JvmRouteBinderValve">org.apache.catalina.ha.session.JvmRouteBinderValve</h3><div class="text"> |
||
| 52 | In case of a mod_jk failover, the <code>JvmRouteBinderValve</code> will replace the |
||
| 53 | <code>jvmWorker</code> attribute in the session Id, to make future requests stick to this |
||
| 54 | node. If you want fallback capability, don't enable this valve, but if you want your failover to stick, |
||
| 55 | and for mod_jk not to have to keep probing the node that went down, you use this valve. |
||
| 56 | <div class="subsection"><h4 id="org.apache.catalina.ha.session.JvmRouteBinderValve/Attributes">Attributes</h4><div class="text"> |
||
| 57 | <table class="defaultTable"><tr><th style="width: 15%;"> |
||
| 58 | Attribute |
||
| 59 | </th><th style="width: 85%;"> |
||
| 60 | Description |
||
| 61 | </th></tr><tr id="org.apache.catalina.ha.session.JvmRouteBinderValve_Attributes_className"><td><strong><code class="attributeName">className</code></strong></td><td> |
||
| 62 | <code>org.apache.catalina.ha.session.JvmRouteBinderValve</code> |
||
| 63 | </td></tr><tr id="org.apache.catalina.ha.session.JvmRouteBinderValve_Attributes_enabled"><td><code class="attributeName">enabled</code></td><td> |
||
| 64 | Default value is <code>true</code> |
||
| 65 | Runtime attribute to turn on and off turn over of the session's jvmRoute value. |
||
| 66 | </td></tr><tr id="org.apache.catalina.ha.session.JvmRouteBinderValve_Attributes_sessionIdAttribute"><td><code class="attributeName">sessionIdAttribute</code></td><td> |
||
| 67 | Old sessionid before failover is registered in request attributes with this attribute. |
||
| 68 | Default attribute name is <code>org.apache.catalina.ha.session.JvmRouteOriginalSessionID</code>. |
||
| 69 | </td></tr></table> |
||
| 70 | </div></div> |
||
| 71 | </div><h3 id="org.apache.catalina.ha.authenticator.ClusterSingleSignOn">org.apache.catalina.ha.authenticator.ClusterSingleSignOn</h3><div class="text"> |
||
| 72 | The <code>ClusterSingleSignOn</code> supports feature of single sign on in cluster. |
||
| 73 | By using <code>ClusterSingleSignOn</code>, the security identity authenticated |
||
| 74 | by one web application is recognized by other web applications on the same virtual host, |
||
| 75 | and it is propagated to other nodes in the cluster. |
||
| 76 | |||
| 77 | <p>See the <a href="host.html#Single_Sign_On">Single Sign On</a> special |
||
| 78 | feature on the <strong>Host</strong> element for more information.</p> |
||
| 79 | |||
| 80 | <p><strong>Note:</strong> ClusterSingleSignOn can be configured at host level cluster only. |
||
| 81 | </p> |
||
| 82 | |||
| 83 | <div class="subsection"><h4 id="org.apache.catalina.ha.authenticator.ClusterSingleSignOn/Attributes">Attributes</h4><div class="text"> |
||
| 84 | <table class="defaultTable"><tr><th style="width: 15%;"> |
||
| 85 | Attribute |
||
| 86 | </th><th style="width: 85%;"> |
||
| 87 | Description |
||
| 88 | </th></tr><tr id="org.apache.catalina.ha.authenticator.ClusterSingleSignOn_Attributes_className"><td><strong><code class="attributeName">className</code></strong></td><td> |
||
| 89 | <p>Java class name of the implementation to use. This MUST be set to |
||
| 90 | <strong>org.apache.catalina.ha.authenticator.ClusterSingleSignOn</strong>.</p> |
||
| 91 | </td></tr><tr id="org.apache.catalina.ha.authenticator.ClusterSingleSignOn_Attributes_cookieDomain"><td><code class="attributeName">cookieDomain</code></td><td> |
||
| 92 | <p>Sets the host domain to be used for sso cookies.</p> |
||
| 93 | </td></tr><tr id="org.apache.catalina.ha.authenticator.ClusterSingleSignOn_Attributes_mapSendOptions"><td><code class="attributeName">mapSendOptions</code></td><td> |
||
| 94 | <p>The Valve uses a replicated map. You can setup the flag for how this |
||
| 95 | map sends messages. The default value is <code>6</code> (synchronous). |
||
| 96 | Note that if you use asynchronous messaging it is possible for update |
||
| 97 | messages to be processed by the receiving node in a different order to |
||
| 98 | the order in which they were sent.</p> |
||
| 99 | </td></tr><tr id="org.apache.catalina.ha.authenticator.ClusterSingleSignOn_Attributes_requireReauthentication"><td><code class="attributeName">requireReauthentication</code></td><td> |
||
| 100 | <p>Default false. Flag to determine whether each request needs to be |
||
| 101 | reauthenticated to the security <strong>Realm</strong>. If "true", this |
||
| 102 | Valve uses cached security credentials (username and password) to |
||
| 103 | reauthenticate to the <strong>Realm</strong> each request associated |
||
| 104 | with an SSO session. If "false", the Valve can itself authenticate |
||
| 105 | requests based on the presence of a valid SSO cookie, without |
||
| 106 | rechecking with the <strong>Realm</strong>.</p> |
||
| 107 | </td></tr><tr id="org.apache.catalina.ha.authenticator.ClusterSingleSignOn_Attributes_rpcTimeout"><td><code class="attributeName">rpcTimeout</code></td><td> |
||
| 108 | <p>The Valve uses a replicated map. This is the timeout for messages |
||
| 109 | that transfer state to/from the other nodes in the cluster. If not |
||
| 110 | specified, a default value of <code>15000</code> milliseconds is used. |
||
| 111 | </p> |
||
| 112 | </td></tr><tr id="org.apache.catalina.ha.authenticator.ClusterSingleSignOn_Attributes_terminateOnStartFailure"><td><code class="attributeName">terminateOnStartFailure</code></td><td> |
||
| 113 | <p>Set to <code>true</code> if you wish this Valve to fail if the |
||
| 114 | underlying replication fails to start. If the Valve fails, then the |
||
| 115 | associated container will fail to start. If you set this attribute to |
||
| 116 | false, and the underlying replications fails to start, the Valve will |
||
| 117 | start and it will attempt to join the cluster and start replication as |
||
| 118 | part of the heartbeat process. If not specified, the default value of |
||
| 119 | <code>false</code> is used.</p> |
||
| 120 | </td></tr><tr id="org.apache.catalina.ha.authenticator.ClusterSingleSignOn_Attributes_accessTimeout"><td><code class="attributeName">accessTimeout</code></td><td> |
||
| 121 | The timeout for a ping message. If a remote map does not respond within |
||
| 122 | this timeout period, its regarded as disappeared. |
||
| 123 | Default value is <code>5000</code> milliseconds. |
||
| 124 | </td></tr></table> |
||
| 125 | </div></div> |
||
| 126 | </div></div></div></div></div><footer><div id="footer"> |
||
| 127 | Copyright © 1999-2025, The Apache Software Foundation |
||
| 128 | <br> |
||
| 129 | Apache Tomcat, Tomcat, Apache, the Apache Tomcat logo and the Apache logo |
||
| 130 | are either registered trademarks or trademarks of the Apache Software |
||
| 131 | Foundation. |
||
| 132 | </div></footer></div></body></html> |