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 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 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="#Engine_vs_Host_placement">Engine vs Host placement</a></li><li><a href="#Context_Attribute_Replication">Context Attribute Replication</a></li><li><a href="#Nested_Components">Nested Components</a></li><li><a href="#Deprecated_configuration_options">Deprecated configuration options</a></li><li><a href="#Attributes">Attributes</a><ol><li><a href="#SimpleTcpCluster_Attributes">SimpleTcpCluster 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 | The tomcat cluster implementation provides session replication, context attribute replication and
|
| 11 | cluster wide WAR file deployment.
|
| 12 | While the <code>Cluster</code> configuration is fairly complex, the default configuration will work
|
| 13 | for most people out of the box. </p><p>
|
| 14 | The Tomcat Cluster implementation is very extensible, and hence we have exposed a myriad of options,
|
| 15 | making the configuration seem like a lot, but don't lose faith, instead you have a tremendous control
|
| 16 | over what is going on.</p>
|
| 17 | </blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Engine vs Host placement"><!--()--></a><a name="Engine_vs_Host_placement"><strong>Engine vs Host placement</strong></a></font></td></tr><tr><td><blockquote>
|
| 18 | <p>
|
| 19 | You can place the <code><Cluster></code> element inside either the <code><Engine></code>
|
| 20 | container or the <code><Host></code> container.<br>
|
| 21 | Placing it in the engine, means that you will support clustering in all virtual hosts of Tomcat,
|
| 22 | and share the messaging component. When you place the <code><Cluster></code> inside the <code><Engine></code>
|
| 23 | element, the cluster will append the host name of each session manager to the managers name so that two contexts with
|
| 24 | the same name but sitting inside two different hosts will be distinguishable.
|
| 25 | </p>
|
| 26 | </blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Context Attribute Replication"><!--()--></a><a name="Context_Attribute_Replication"><strong>Context Attribute Replication</strong></a></font></td></tr><tr><td><blockquote>
|
| 27 | <p>To configure context attribute replication, simply do this by swapping out the context implementation
|
| 28 | used for your application context.
|
| 29 | <div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="../images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="../images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="../images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="../images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre><Context className="org.apache.catalina.ha.context.ReplicatedContext"/></pre></td><td bgcolor="#023264" width="1"><img src="../images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="../images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="../images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="../images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
|
| 30 | This context extends the Tomcat <code><a href="context.html">StandardContext</a></code>
|
| 31 | so all the options from the <a href="context.html">base implementation</a> are valid.
|
| 32 | </p>
|
| 33 | </blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Nested Components"><!--()--></a><a name="Nested_Components"><strong>Nested Components</strong></a></font></td></tr><tr><td><blockquote>
|
| 34 | <p><b><a href="cluster-manager.html">Manager</a>:</b> <br>
|
| 35 | The session manager element identifies what kind of session manager is used in this cluster implementation.
|
| 36 | This manager configuration is identical to the one you would use in a regular <code><a href="context.html#Nested%20xComponents"><Context></a></code> configuration.
|
| 37 | <br>The default value is the <code>org.apache.catalina.ha.session.DeltaManager</code> that is closely coupled with
|
| 38 | the <code>SimpleTcpCluster</code> implementation. Other managers like the <code>org.apache.catalina.ha.session.BackupManager</code>
|
| 39 | are/could be loosely coupled and don't rely on the <code>SimpleTcpCluster</code> for its data replication.
|
| 40 | </p>
|
| 41 | <p><b><a href="cluster-channel.html">Channel</a>:</b> <br>
|
| 42 | The Channel and its sub components are all part of the IO layer
|
| 43 | for the cluster group, and is a module in it's own that we have nick named "Tribes"
|
| 44 | <br>
|
| 45 | Any configuring and tuning of the network layer, the messaging and the membership logic
|
| 46 | will be done in the channel and its nested components.
|
| 47 | You can always find out more about <a href="../tribes/introduction.html">Apache Tribes</a>
|
| 48 | </p>
|
| 49 | <p><b><a href="cluster-valve.html">Valve</a>:</b> <br>
|
| 50 | The Tomcat Cluster implementation uses <code>Tomcat <a href="valve.html">Valves</a></code> to
|
| 51 | track when requests enter and exit the servlet container. It uses these valves to be able to make
|
| 52 | intelligent decisions on when to replicate data, which is always at the end of a request.
|
| 53 | </p>
|
| 54 | <p><b><a href="cluster-deployer.html">Deployer</a>:</b> <br>
|
| 55 | The Deployer component is the Tomcat Farm Deployer. It allows you to deploy and undeploy applications
|
| 56 | cluster wide.
|
| 57 | </p>
|
| 58 | <p><b><a href="cluster-listener.html">ClusterListener</a>:</b> <br>
|
| 59 | ClusterListener's are used to track messages sent and received using the <code>SimpleTcpCluster</code>.
|
| 60 | If you wish to track messages, you can add a listener here, or you can add a valve to the channel object.
|
| 61 | </p>
|
| 62 | </blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Deprecated configuration options"><!--()--></a><a name="Deprecated_configuration_options"><strong>Deprecated configuration options</strong></a></font></td></tr><tr><td><blockquote>
|
| 63 | <p>
|
| 64 | <b>Deprecated settings:</b> In the previous version of Tomcat you were able to control session
|
| 65 | manager settings using manager.<property>=value.
|
| 66 | This has been discontinued, as the way it was written interferes with
|
| 67 | the ability to support multiple different manager classes under one cluster implementation,
|
| 68 | as the same properties might have the different effect on different managers.
|
| 69 | </p>
|
| 70 | </blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Attributes"><strong>Attributes</strong></a></font></td></tr><tr><td><blockquote>
|
| 71 | <table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="SimpleTcpCluster Attributes"><!--()--></a><a name="SimpleTcpCluster_Attributes"><strong>SimpleTcpCluster Attributes</strong></a></font></td></tr><tr><td><blockquote>
|
| 72 | <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">
|
| 73 | <p>The main cluster class, currently only one is available,
|
| 74 | <code>org.apache.catalina.ha.tcp.SimpleTcpCluster</code>
|
| 75 | </p>
|
| 76 | </td></tr><tr><td align="left" valign="center"><strong><code>channelSendOptions</code></strong></td><td align="left" valign="center">
|
| 77 | <p>The Tribes channel send options, default is <code>8</code>.<br>
|
| 78 | This option is used to set the flag that all messages sent through the
|
| 79 | SimpleTcpCluster uses. The flag decides how the messages are sent, and is a simple logical OR.<br>
|
| 80 |
|
| 81 | <div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="../images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="../images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="../images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="../images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
|
| 82 | int options= Channel.SEND_OPTIONS_ASYNCHRONOUS |
|
| 83 | Channel.SEND_OPTIONS_SYNCHRONIZED_ACK |
|
| 84 | Channel.SEND_OPTIONS_USE_ACK;
|
| 85 | </pre></td><td bgcolor="#023264" width="1"><img src="../images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="../images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="../images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="../images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
|
| 86 | Some of the values are:<br>
|
| 87 | <code>Channel.SEND_OPTIONS_SYNCHRONIZED_ACK = 0x0004</code><br>
|
| 88 | <code>Channel.SEND_OPTIONS_ASYNCHRONOUS = 0x0008</code><br>
|
| 89 | <code>Channel.SEND_OPTIONS_USE_ACK = 0x0002</code><br>
|
| 90 | So to use ACK and ASYNC messaging, the flag would be <code>10 (8+2) or 0x000B</code><br>
|
| 91 | Note that if you use ASYNC messaging it is possible for update messages
|
| 92 | for a session to be processed by the receiving nodes in a different order
|
| 93 | to the order in which they were sent.
|
| 94 | </p>
|
| 95 | </td></tr><tr><td align="left" valign="center"><code>channelStartOptions</code></td><td align="left" valign="center">
|
| 96 | <p>Sets the start and stop flags for the <Channel> object used by the cluster.
|
| 97 | The default is <code>Channel.DEFAULT</code> which starts all the channel services, such as
|
| 98 | sender, receiver, multicast sender and multicast receiver.
|
| 99 | The following flags are available today:
|
| 100 | <div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="../images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="../images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="../images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="../images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
|
| 101 | Channel.DEFAULT = Channel.SND_RX_SEQ (1)| Channel.SND_TX_SEQ (2)| Channel.MBR_RX_SEQ (4)| Channel.MBR_TX_SEQ (8);
|
| 102 | </pre></td><td bgcolor="#023264" width="1"><img src="../images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="../images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="../images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="../images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
|
| 103 | To start a channel without multicasting, you would want to use the value <code>Channel.SND_RX_SEQ | Channel.SND_TX_SEQ</code>
|
| 104 | that equals to <code>3</code>.
|
| 105 | </p>
|
| 106 | </td></tr><tr><td align="left" valign="center"><code>heartbeatBackgroundEnabled</code></td><td align="left" valign="center">
|
| 107 | <p>Flag whether invoke channel heartbeat at container background thread. Default value is false.
|
| 108 | Enable this flag don't forget to disable the channel heartbeat thread.
|
| 109 | </p>
|
| 110 | </td></tr><tr><td align="left" valign="center"><code>notifyLifecycleListenerOnFailure</code></td><td align="left" valign="center">
|
| 111 | <p>Flag whether notify LifecycleListeners if all ClusterListener couldn't accept channel message.
|
| 112 | Default value is false.
|
| 113 | </p>
|
| 114 | </td></tr><tr><td align="left" valign="center"><code>doClusterLog</code></td><td align="left" valign="center">
|
| 115 | <p><b>Deprecated since 6.0.0</b></p>
|
| 116 | <p>Possible values are <code>true</code> or <code>false</code><br>
|
| 117 | Value is inherited from Tomcat 5.5 and has no official meaning.
|
| 118 | to configure logging, use the standard tomcat logging configuration.
|
| 119 | </p>
|
| 120 | </td></tr><tr><td align="left" valign="center"><code>clusterLogName</code></td><td align="left" valign="center">
|
| 121 | <p><b>Deprecated since 6.0.0</b></p>
|
| 122 | <p>
|
| 123 | Value is inherited from Tomcat 5.5 and has no official meaning.
|
| 124 | to configure logging, use the standard tomcat logging configuration.
|
| 125 | </p>
|
| 126 | </td></tr></table>
|
| 127 | </blockquote></td></tr></table>
|
| 128 | </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>
|
| 129 | Copyright © 1999-2014, Apache Software Foundation
|
| 130 | </em></font></div></td></tr></table></body></html> |