Subversion Repositories Integrator Subversion

Rev

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 ClusterManager 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 ClusterManager 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="#The_<Manager>">The &lt;Manager&gt;</a></li><li><a href="#Attributes">Attributes</a><ol><li><a href="#Common_Attributes">Common Attributes</a></li><li><a href="#org.apache.catalina.ha.session.DeltaManager_Attributes">org.apache.catalina.ha.session.DeltaManager Attributes</a></li><li><a href="#org.apache.catalina.ha.session.BackupManager_Attributes">org.apache.catalina.ha.session.BackupManager Attributes</a></li></ol></li><li><a href="#Nested_Components">Nested Components</a></li></ul>
6
</div><h3 id="Introduction">Introduction</h3><div class="text">
7
  <p>A cluster manager is an extension to Tomcat's session manager interface,
8
  <code>org.apache.catalina.Manager</code>.
9
  A cluster manager must implement the
10
  <code>org.apache.catalina.ha.ClusterManager</code> and is solely  responsible
11
  for how the session is replicated.<br>
12
  There are currently two different managers, the
13
  <code>org.apache.catalina.ha.session.DeltaManager</code> replicates deltas of
14
  session data to all members in the cluster. This implementation is proven and
15
  works very well, but has a limitation as it requires the cluster members to be
16
  homogeneous, all nodes must deploy the same applications and be exact
17
  replicas. The <code>org.apache.catalina.ha.session.BackupManager</code> also
18
  replicates deltas but only to one backup node. The location of the backup node
19
  is known to all nodes in the cluster. It also supports heterogeneous
20
  deployments, so the manager knows at what locations the web application is
21
  deployed.</p>
22
</div><h3 id="The_<Manager>">The &lt;Manager&gt;</h3><div class="text">
23
  <p>The <code>&lt;Manager&gt;</code> element defined inside the
24
  <code>&lt;Cluster&gt;</code> element is the template defined for all web
25
  applications that are marked <code>&lt;distributable/&gt;</code> in their
26
  <code>web.xml</code> file. However, you can still override the manager
27
  implementation on a per web application basis, by putting the
28
  <code>&lt;Manager&gt;</code> inside the <code>&lt;Context&gt;</code> element
29
  either in the <code><a href="context.html">context.xml</a></code> file or the
30
  <code><a href="index.html">server.xml</a></code> file.</p>
31
</div><h3 id="Attributes">Attributes</h3><div class="text">
32
  <div class="subsection"><h4 id="Common_Attributes">Common Attributes</h4><div class="text">
33
    <table class="defaultTable"><tr><th style="width: 15%;">
34
          Attribute
35
        </th><th style="width: 85%;">
36
          Description
37
        </th></tr><tr id="Attributes_Common Attributes_className"><td><strong><code class="attributeName">className</code></strong></td><td>
38
      </td></tr><tr id="Attributes_Common Attributes_name"><td><code class="attributeName">name</code></td><td>
39
        <b>The name of this cluster manager, the name is used to identify a
40
        session manager on a node. The name might get modified by the
41
        <code>Cluster</code> element to make it unique in the container.</b>
42
      </td></tr><tr id="Attributes_Common Attributes_notifyListenersOnReplication"><td><code class="attributeName">notifyListenersOnReplication</code></td><td>
43
        Set to <code>true</code> if you wish to have session listeners notified
44
        when session attributes are being replicated or removed across Tomcat
45
        nodes in the cluster.
46
      </td></tr><tr id="Attributes_Common Attributes_processExpiresFrequency"><td><code class="attributeName">processExpiresFrequency</code></td><td>
47
        <p>Frequency of the session expiration, and related manager operations.
48
        Manager operations will be done once for the specified amount of
49
        backgroundProcess calls (i.e., the lower the amount, the more often the
50
        checks will occur). The minimum value is 1, and the default value is 6.
51
        </p>
52
      </td></tr><tr id="Attributes_Common Attributes_secureRandomClass"><td><code class="attributeName">secureRandomClass</code></td><td>
53
        <p>Name of the Java class that extends
54
        <code>java.security.SecureRandom</code> to use to generate session IDs.
55
        If not specified, the default value is
56
        <code>java.security.SecureRandom</code>.</p>
57
      </td></tr><tr id="Attributes_Common Attributes_secureRandomProvider"><td><code class="attributeName">secureRandomProvider</code></td><td>
58
        <p>Name of the provider to use to create the
59
        <code>java.security.SecureRandom</code> instances that generate session
60
        IDs. If an invalid algorithm and/or provider is specified, the Manager
61
        will use the platform default provider and the default algorithm. If not
62
        specified, the platform default provider will be used.</p>
63
      </td></tr><tr id="Attributes_Common Attributes_secureRandomAlgorithm"><td><code class="attributeName">secureRandomAlgorithm</code></td><td>
64
        <p>Name of the algorithm to use to create the
65
        <code>java.security.SecureRandom</code> instances that generate session
66
        IDs. If an invalid algorithm and/or provider is specified, the Manager
67
        will use the platform default provider and the default algorithm. If not
68
        specified, the default algorithm of SHA1PRNG will be used. If the
69
        default algorithm is not supported, the platform default will be used.
70
        To specify that the platform default should be used, do not set the
71
        secureRandomProvider attribute and set this attribute to the empty
72
        string.</p>
73
      </td></tr><tr id="Attributes_Common Attributes_recordAllActions"><td><code class="attributeName">recordAllActions</code></td><td>
74
        <p>Flag whether send all actions for session across Tomcat cluster
75
        nodes. If set to false, if already done something to the same attribute,
76
        make sure don't send multiple actions across Tomcat cluster nodes.
77
        In that case, sends only the actions that have been added at last.
78
        Default is <code>false</code>.</p>
79
      </td></tr></table>
80
  </div></div>
81
  <div class="subsection"><h4 id="org.apache.catalina.ha.session.DeltaManager_Attributes">org.apache.catalina.ha.session.DeltaManager Attributes</h4><div class="text">
82
    <table class="defaultTable"><tr><th style="width: 15%;">
83
          Attribute
84
        </th><th style="width: 85%;">
85
          Description
86
        </th></tr><tr id="Attributes_org.apache.catalina.ha.session.DeltaManager Attributes_enableStatistics"><td><code class="attributeName">enableStatistics</code></td><td>
87
        Tracks statistics for the session and events of the cluster.
88
        Default value is <code>true</code>.
89
      </td></tr><tr id="Attributes_org.apache.catalina.ha.session.DeltaManager Attributes_expireSessionsOnShutdown"><td><code class="attributeName">expireSessionsOnShutdown</code></td><td>
90
        When a web application is being shutdown, Tomcat issues an expire call
91
        to each session to notify all the listeners. If you wish for all
92
        sessions to expire on all nodes when a shutdown occurs on one node, set
93
        this value to <code>true</code>.
94
        Default value is <code>false</code>.
95
      </td></tr><tr id="Attributes_org.apache.catalina.ha.session.DeltaManager Attributes_maxActiveSessions"><td><code class="attributeName">maxActiveSessions</code></td><td>
96
        The maximum number of active sessions that will be created by this
97
        Manager, or -1 (the default) for no limit. For this manager, all
98
        sessions are counted as active sessions irrespective if whether or not
99
        the current node is the primary node for the session.
100
      </td></tr><tr id="Attributes_org.apache.catalina.ha.session.DeltaManager Attributes_notifySessionListenersOnReplication"><td><code class="attributeName">notifySessionListenersOnReplication</code></td><td>
101
        Set to <code>true</code> if you wish to have session listeners notified
102
        when sessions are created and expired across Tomcat nodes in the
103
        cluster.
104
      </td></tr><tr id="Attributes_org.apache.catalina.ha.session.DeltaManager Attributes_notifyContainerListenersOnReplication"><td><code class="attributeName">notifyContainerListenersOnReplication</code></td><td>
105
        Set to <code>true</code> if you wish to have container listeners notified
106
        across Tomcat nodes in the cluster.
107
      </td></tr><tr id="Attributes_org.apache.catalina.ha.session.DeltaManager Attributes_persistAuthenticationNotes"><td><code class="attributeName">persistAuthenticationNotes</code></td><td>
108
        <p>Should authentication notes (used during FORM authentication) be
109
        included when sessions are replicated? If <code>true</code>, the
110
        session's authentication notes (used during FORM authentication) are
111
        replicated so that an in progress FORM authentication can continue if
112
        failover occurs during FORM authentication. If not specified, the
113
        default value of <code>false</code> will be used.</p>
114
 
115
        <p>Please note that all nodes must be upgraded to at least 9.0.66 (the
116
        version where this feature was introduced) before this feature is
117
        enabled else session replication may fail.</p>
118
 
119
        <p>This attribute has been removed for Tomcat 10.1.x onwards which
120
        always replicates FORM authenticaton notes.</p>
121
      </td></tr><tr id="Attributes_org.apache.catalina.ha.session.DeltaManager Attributes_stateTransferTimeout"><td><code class="attributeName">stateTransferTimeout</code></td><td>
122
        The time in seconds to wait for a session state transfer to complete
123
        from another node when a node is starting up.
124
        Default value is <code>60</code> seconds.
125
      </td></tr><tr id="Attributes_org.apache.catalina.ha.session.DeltaManager Attributes_sendAllSessions"><td><code class="attributeName">sendAllSessions</code></td><td>
126
        Flag whether send sessions as split blocks.
127
        If set to <code>true</code>, send all sessions as one big block.
128
        If set to <code>false</code>, send sessions as split blocks.
129
        Default value is <code>true</code>.
130
      </td></tr><tr id="Attributes_org.apache.catalina.ha.session.DeltaManager Attributes_sendAllSessionsSize"><td><code class="attributeName">sendAllSessionsSize</code></td><td>
131
        The number of sessions in a session block message. This value is
132
        effective only when <code>sendAllSessions</code> is <code>false</code>.
133
        Default is <code>1000</code>.
134
      </td></tr><tr id="Attributes_org.apache.catalina.ha.session.DeltaManager Attributes_sendAllSessionsWaitTime"><td><code class="attributeName">sendAllSessionsWaitTime</code></td><td>
135
        Wait time between sending of session block messages. This value is
136
        effective only when <code>sendAllSessions</code> is <code>false</code>.
137
        Default is <code>2000</code> milliseconds.
138
      </td></tr><tr id="Attributes_org.apache.catalina.ha.session.DeltaManager Attributes_sessionAttributeNameFilter"><td><code class="attributeName">sessionAttributeNameFilter</code></td><td>
139
        <p>A regular expression used to filter which session attributes will be
140
        replicated. An attribute will only be replicated if its name matches
141
        this pattern. If the pattern is zero length or <code>null</code>, all
142
        attributes are eligible for replication. The pattern is anchored so the
143
        session attribute name must fully match the pattern. As an example, the
144
        value <code>(userName|sessionHistory)</code> will only replicate the
145
        two session attributes named <code>userName</code> and
146
        <code>sessionHistory</code>. If not specified, the default value of
147
        <code>null</code> will be used.</p>
148
      </td></tr><tr id="Attributes_org.apache.catalina.ha.session.DeltaManager Attributes_sessionAttributeValueClassNameFilter"><td><code class="attributeName">sessionAttributeValueClassNameFilter</code></td><td>
149
        <p>A regular expression used to filter which session attributes will be
150
        replicated. An attribute will only be replicated if the implementation
151
        class name of the value matches this pattern. If the pattern is zero
152
        length or <code>null</code>, all attributes are eligible for
153
        replication. The pattern is anchored so the fully qualified class name
154
        must fully match the pattern. If not specified, the default value of
155
        <code>null</code> will be used unless a <code>SecurityManager</code> is
156
        enabled in which case the default will be
157
        <code>java\\.lang\\.(?:Boolean|Integer|Long|Number|String)</code>.</p>
158
      </td></tr><tr id="Attributes_org.apache.catalina.ha.session.DeltaManager Attributes_stateTimestampDrop"><td><code class="attributeName">stateTimestampDrop</code></td><td>
159
        When this node sends a <code>GET_ALL_SESSIONS</code> message to other
160
        node, all session messages that are received as a response are queued.
161
        If this attribute is set to <code>true</code>, the received session
162
        messages (except any <code>GET_ALL_SESSIONS</code> sent by other nodes)
163
        are filtered by their timestamp. A message is dropped if it is not a
164
        <code>GET_ALL_SESSIONS</code> message and its timestamp is earlier than
165
        the timestamp of our <code>GET_ALL_SESSIONS</code> message.
166
        If set to <code>false</code>, all queued session messages are handled.
167
        Default is <code>true</code>.
168
      </td></tr><tr id="Attributes_org.apache.catalina.ha.session.DeltaManager Attributes_warnOnSessionAttributeFilterFailure"><td><code class="attributeName">warnOnSessionAttributeFilterFailure</code></td><td>
169
        <p>If <strong>sessionAttributeNameFilter</strong> or
170
        <strong>sessionAttributeValueClassNameFilter</strong> blocks an
171
        attribute, should this be logged at <code>WARN</code> level? If
172
        <code>WARN</code> level logging is disabled then it will be logged at
173
        <code>DEBUG</code>. The default value of this attribute is
174
        <code>false</code> unless a <code>SecurityManager</code> is enabled in
175
        which case the default will be <code>true</code>.</p>
176
      </td></tr></table>
177
  </div></div>
178
  <div class="subsection"><h4 id="org.apache.catalina.ha.session.BackupManager_Attributes">org.apache.catalina.ha.session.BackupManager Attributes</h4><div class="text">
179
    <table class="defaultTable"><tr><th style="width: 15%;">
180
          Attribute
181
        </th><th style="width: 85%;">
182
          Description
183
        </th></tr><tr id="Attributes_org.apache.catalina.ha.session.BackupManager Attributes_mapSendOptions"><td><code class="attributeName">mapSendOptions</code></td><td>
184
        The backup manager uses a replicated map, this map is sending and
185
        receiving messages. You can setup the flag for how this map is sending
186
        messages, the default value is <code>6</code>(synchronous).<br>
187
        Note that if you use asynchronous messaging it is possible for update
188
        messages for a session to be processed by the receiving node in a
189
        different order to the order in which they were sent.
190
      </td></tr><tr id="Attributes_org.apache.catalina.ha.session.BackupManager Attributes_maxActiveSessions"><td><code class="attributeName">maxActiveSessions</code></td><td>
191
        The maximum number of active sessions that will be created by this
192
        Manager, or -1 (the default) for no limit. For this manager, only
193
        sessions where the current node is the primary node for the session are
194
        considered active sessions.
195
      </td></tr><tr id="Attributes_org.apache.catalina.ha.session.BackupManager Attributes_persistAuthenticationNotes"><td><code class="attributeName">persistAuthenticationNotes</code></td><td>
196
        <p>Should authentication notes (used during FORM authentication) be
197
        included when sessions are replicated? If <code>true</code>, the
198
        session's authentication notes (used during FORM authentication) are
199
        replicated so that an in progress FORM authentication can continue if
200
        failover occurs during FORM authentication. If not specified, the
201
        default value of <code>false</code> will be used.</p>
202
 
203
        <p>Please note that all nodes must be upgraded to at least 9.0.66 (the
204
        version where this feature was introduced) before this feature is
205
        enabled else session replication may fail.</p>
206
 
207
        <p>This attribute has been removed for Tomcat 10.1.x onwards which
208
        always replicates FORM authenticaton notes.</p>
209
      </td></tr><tr id="Attributes_org.apache.catalina.ha.session.BackupManager Attributes_rpcTimeout"><td><code class="attributeName">rpcTimeout</code></td><td>
210
        Timeout for RPC message used for broadcast and transfer state from
211
        another map.
212
        Default value is <code>15000</code> milliseconds.
213
      </td></tr><tr id="Attributes_org.apache.catalina.ha.session.BackupManager Attributes_sessionAttributeNameFilter"><td><code class="attributeName">sessionAttributeNameFilter</code></td><td>
214
        <p>A regular expression used to filter which session attributes will be
215
        replicated. An attribute will only be replicated if its name matches
216
        this pattern. If the pattern is zero length or <code>null</code>, all
217
        attributes are eligible for replication. The pattern is anchored so the
218
        session attribute name must fully match the pattern. As an example, the
219
        value <code>(userName|sessionHistory)</code> will only replicate the
220
        two session attributes named <code>userName</code> and
221
        <code>sessionHistory</code>. If not specified, the default value of
222
        <code>null</code> will be used.</p>
223
      </td></tr><tr id="Attributes_org.apache.catalina.ha.session.BackupManager Attributes_sessionAttributeValueClassNameFilter"><td><code class="attributeName">sessionAttributeValueClassNameFilter</code></td><td>
224
        <p>A regular expression used to filter which session attributes will be
225
        replicated. An attribute will only be replicated if the implementation
226
        class name of the value matches this pattern. If the pattern is zero
227
        length or <code>null</code>, all attributes are eligible for
228
        replication. The pattern is anchored so the fully qualified class name
229
        must fully match the pattern. If not specified, the default value of
230
        <code>null</code> will be used unless a <code>SecurityManager</code> is
231
        enabled in which case the default will be
232
        <code>java\\.lang\\.(?:Boolean|Integer|Long|Number|String)</code>.</p>
233
      </td></tr><tr id="Attributes_org.apache.catalina.ha.session.BackupManager Attributes_terminateOnStartFailure"><td><code class="attributeName">terminateOnStartFailure</code></td><td>
234
        Set to true if you wish to terminate replication map when replication
235
        map fails to start. If replication map is terminated, associated context
236
        will fail to start. If you set this attribute to false, replication map
237
        does not end. It will try to join the map membership in the heartbeat.
238
        Default value is <code>false</code> .
239
      </td></tr><tr id="Attributes_org.apache.catalina.ha.session.BackupManager Attributes_warnOnSessionAttributeFilterFailure"><td><code class="attributeName">warnOnSessionAttributeFilterFailure</code></td><td>
240
        <p>If <strong>sessionAttributeNameFilter</strong> or
241
        <strong>sessionAttributeValueClassNameFilter</strong> blocks an
242
        attribute, should this be logged at <code>WARN</code> level? If
243
        <code>WARN</code> level logging is disabled then it will be logged at
244
        <code>DEBUG</code>. The default value of this attribute is
245
        <code>false</code> unless a <code>SecurityManager</code> is enabled in
246
        which case the default will be <code>true</code>.</p>
247
      </td></tr><tr id="Attributes_org.apache.catalina.ha.session.BackupManager Attributes_accessTimeout"><td><code class="attributeName">accessTimeout</code></td><td>
248
        The timeout for a ping message. If a remote map does not respond within
249
        this timeout period, its regarded as disappeared.
250
        Default value is <code>5000</code> milliseconds.
251
      </td></tr></table>
252
  </div></div>
253
</div><h3 id="Nested_Components">Nested Components</h3><div class="text">
254
  <h3>All Manager Implementations</h3>
255
  <p>All Manager implementations allow nesting of a
256
  <strong>&lt;SessionIdGenerator&gt;</strong> element. It defines
257
  the behavior of session id generation.  All implementations
258
  of the <a href="sessionidgenerator.html">SessionIdGenerator</a> allow the
259
  following attributes:
260
  </p>
261
  <table class="defaultTable"><tr><th style="width: 15%;">
262
          Attribute
263
        </th><th style="width: 85%;">
264
          Description
265
        </th></tr><tr id="_Nested Components_sessionIdLength"><td><code class="attributeName">sessionIdLength</code></td><td>
266
      <p>The length of the session ID may be changed with the
267
      <strong>sessionIdLength</strong> attribute.
268
      </p>
269
    </td></tr></table>
270
</div></div></div></div></div><footer><div id="footer">
271
    Copyright &copy; 1999-2025, The Apache Software Foundation
272
    <br>
273
    Apache Tomcat, Tomcat, Apache, the Apache Tomcat logo and the Apache logo
274
    are either registered trademarks or trademarks of the Apache Software
275
    Foundation.
276
    </div></footer></div></body></html>