1 | <html><head><META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>Apache Tomcat Configuration Reference - The Cluster object</title><meta value="Filip Hanik" name="author"><meta value="fhanik@apache.org" name="email"></head><body vlink="#525D76" alink="#525D76" link="#525D76" text="#000000" bgcolor="#ffffff"><table cellspacing="0" width="100%" border="0"><!--PAGE HEADER--><tr><td><!--PROJECT LOGO--><a href="http://tomcat.apache.org/"><img border="0" alt=" |
---|
2 | The Apache Tomcat Servlet/JSP Container |
---|
3 | " align="right" src="../../images/tomcat.gif"></a></td><td><font face="arial,helvetica,sanserif"><h1>Apache Tomcat 6.0</h1></font></td><td><!--APACHE LOGO--><a href="http://www.apache.org/"><img border="0" alt="Apache Logo" align="right" src="../../images/asf-logo.gif"></a></td></tr></table><table cellspacing="4" width="100%" border="0"><!--HEADER SEPARATOR--><tr><td colspan="2"><hr size="1" noshade></td></tr><tr><!--RIGHT SIDE MAIN BODY--><td align="left" valign="top" width="80%"><table cellspacing="4" width="100%" border="0"><tr><td valign="top" align="left"><h1>Apache Tomcat Configuration Reference</h1><h2>The Cluster object</h2></td><td nowrap="true" valign="top" align="right"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td></tr></table><table cellpadding="2" cellspacing="0" border="0"><tr><td bgcolor="#525D76"><font face="arial,helvetica.sanserif" color="#ffffff"><a name="Introduction"><strong>Introduction</strong></a></font></td></tr><tr><td><blockquote> |
---|
4 | <p> |
---|
5 | The tomcat cluster implementation provides session replication, context attribute replication and |
---|
6 | cluster wide WAR file deployment. |
---|
7 | While the <code>Cluster</code> configuration is fairly complex, the default configuration will work |
---|
8 | for most people out of the box. </p><p> |
---|
9 | The Tomcat Cluster implementation is very extensible, and hence we have exposed a myriad of options, |
---|
10 | making the configuration seem like a lot, but don't lose faith, instead you have a tremendous control |
---|
11 | over what is going on.</p> |
---|
12 | </blockquote></td></tr></table><table cellpadding="2" cellspacing="0" border="0"><tr><td bgcolor="#525D76"><font face="arial,helvetica.sanserif" color="#ffffff"><a name="Engine vs Host placement"><strong>Engine vs Host placement</strong></a></font></td></tr><tr><td><blockquote> |
---|
13 | <p> |
---|
14 | You can place the <code><Cluster></code> element inside either the <code><Engine></code> |
---|
15 | container or the <code><Host></code> container.<br> |
---|
16 | Placing it in the engine, means that you will support clustering in all virtual hosts of Tomcat, |
---|
17 | and share the messaging component. When you place the <code><Cluster></code> inside the <code><Engine></code> |
---|
18 | element, the cluster will append the host name of each session manager to the managers name so that two contexts with |
---|
19 | the same name but sitting inside two different hosts will be distinguishable. |
---|
20 | </p> |
---|
21 | </blockquote></td></tr></table><table cellpadding="2" cellspacing="0" border="0"><tr><td bgcolor="#525D76"><font face="arial,helvetica.sanserif" color="#ffffff"><a name="Context Attribute Replication"><strong>Context Attribute Replication</strong></a></font></td></tr><tr><td><blockquote> |
---|
22 | <p>To configure context attribute replication, simply do this by swapping out the context implementation |
---|
23 | used for your application context. |
---|
24 | <div align="left"><table border="0" cellpadding="0" cellspacing="4"><tr><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td><td height="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td></tr><tr><td width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td><td height="1" bgcolor="#ffffff"><pre><Context className="org.apache.catalina.ha.context.ReplicatedContext"/></pre></td><td width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td></tr><tr><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td><td height="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td></tr></table></div> |
---|
25 | This context extends the Tomcat <code><a href="context.html">StandardContext</a></code> |
---|
26 | so all the options from the <a href="context.html">base implementation</a> are valid. |
---|
27 | </p> |
---|
28 | </blockquote></td></tr></table><table cellpadding="2" cellspacing="0" border="0"><tr><td bgcolor="#525D76"><font face="arial,helvetica.sanserif" color="#ffffff"><a name="Nested Components"><strong>Nested Components</strong></a></font></td></tr><tr><td><blockquote> |
---|
29 | <p><b><a href="cluster-manager.html">Manager</a>:</b> <br> |
---|
30 | The session manager element identifies what kind of session manager is used in this cluster implementation. |
---|
31 | 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. |
---|
32 | <br>The default value is the <code>org.apache.catalina.ha.session.DeltaManager</code> that is closely coupled with |
---|
33 | the <code>SimpleTcpCluster</code> implementation. Other managers like the <code>org.apache.catalina.ha.session.BackupManager</code> |
---|
34 | are/could be loosely coupled and don't rely on the <code>SimpleTcpCluster</code> for its data replication. |
---|
35 | </p> |
---|
36 | <p><b><a href="cluster-channel.html">Channel</a>:</b> <br> |
---|
37 | The Channel and its sub components are all part of the IO layer |
---|
38 | for the cluster group, and is a module in it's own that we have nick named "Tribes" |
---|
39 | <br> |
---|
40 | Any configuring and tuning of the network layer, the messaging and the membership logic |
---|
41 | will be done in the channel and its nested components. |
---|
42 | You can always find out more about <a href="../../tribes/introduction.html">Apache Tribes</a> |
---|
43 | </p> |
---|
44 | <p><b><a href="cluster-valve.html">Valve</a>:</b> <br> |
---|
45 | The Tomcat Cluster implementation uses <code>Tomcat <a href="valve.html">Valves</a></code> to |
---|
46 | track when requests enter and exit the servlet container. It uses these valves to be able to make |
---|
47 | intelligent decisions on when to replicate data, which is always at the end of a request. |
---|
48 | </p> |
---|
49 | <p><b><a href="cluster-deployer.html">Deployer</a>:</b> <br> |
---|
50 | The Deployer component is the Tomcat Farm Deployer. It allows you to deploy and undeploy applications |
---|
51 | cluster wide. |
---|
52 | </p> |
---|
53 | <p><b><a href="cluster-listener.html">ClusterListener</a>:</b> <br> |
---|
54 | ClusterListener's are used to track messages sent and received using the <code>SimpleTcpCluster</code>. |
---|
55 | If you wish to track messages, you can add a listener here, or you can add a valve to the channel object. |
---|
56 | </p> |
---|
57 | </blockquote></td></tr></table><table cellpadding="2" cellspacing="0" border="0"><tr><td bgcolor="#525D76"><font face="arial,helvetica.sanserif" color="#ffffff"><a name="Deprecated configuration options"><strong>Deprecated configuration options</strong></a></font></td></tr><tr><td><blockquote> |
---|
58 | <p> |
---|
59 | <b>Deprecated settings:</b> In the previous version of Tomcat you were able to control session |
---|
60 | manager settings using manager.<property>=value. |
---|
61 | This has been discontinued, as the way it was written interfers with |
---|
62 | the ability to support multiple different manager classes under one cluster implementation, |
---|
63 | as the same properties might have the different effect on different managers. |
---|
64 | </p> |
---|
65 | </blockquote></td></tr></table><table cellpadding="2" cellspacing="0" border="0"><tr><td bgcolor="#525D76"><font face="arial,helvetica.sanserif" color="#ffffff"><a name="Attributes"><strong>Attributes</strong></a></font></td></tr><tr><td><blockquote> |
---|
66 | <table cellpadding="2" cellspacing="0" border="0"><tr><td bgcolor="#828DA6"><font face="arial,helvetica.sanserif" color="#ffffff"><a name="SimpleTcpCluster Attributes"><strong>SimpleTcpCluster Attributes</strong></a></font></td></tr><tr><td><blockquote> |
---|
67 | <table cellpadding="5" border="1"><tr><th bgcolor="#023264" width="15%"><font color="#ffffff">Attribute</font></th><th bgcolor="#023264" width="85%"><font color="#ffffff">Description</font></th></tr><tr><td valign="center" align="left"><strong><code>className</code></strong></td><td valign="center" align="left"> |
---|
68 | <p>The main cluster class, currently only one is available, |
---|
69 | <code>org.apache.catalina.ha.tcp.SimpleTcpCluster</code> |
---|
70 | </p> |
---|
71 | </td></tr><tr><td valign="center" align="left"><strong><code>channelSendOptions</code></strong></td><td valign="center" align="left"> |
---|
72 | <p>The Tribes channel send options, default is <code>8</code>.<br> |
---|
73 | This option is used to set the flag that all messages sent through the |
---|
74 | SimpleTcpCluster uses. The flag decides how the messages are sent, and is a simple logical OR.<br> |
---|
75 | |
---|
76 | <div align="left"><table border="0" cellpadding="0" cellspacing="4"><tr><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td><td height="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td></tr><tr><td width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td><td height="1" bgcolor="#ffffff"><pre> |
---|
77 | int options= Channel.SEND_OPTIONS_ASYNCHRONOUS | |
---|
78 | Channel.SEND_OPTIONS_SYNCHRONIZED_ACK | |
---|
79 | Channel.SEND_OPTIONS_USE_ACK; |
---|
80 | </pre></td><td width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td></tr><tr><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td><td height="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td></tr></table></div> |
---|
81 | Some of the values are:<br> |
---|
82 | <code>Channel.SEND_OPTIONS_SYNCHRONIZED_ACK = 0x0004</code><br> |
---|
83 | <code>Channel.SEND_OPTIONS_ASYNCHRONOUS = 0x0008</code><br> |
---|
84 | <code>Channel.SEND_OPTIONS_USE_ACK = 0x0002</code><br> |
---|
85 | So to use ACK and ASYNC messaging, the flag would be <code>10 (8+2) or 0x000B</code><br> |
---|
86 | </p> |
---|
87 | </td></tr><tr><td valign="center" align="left"><code>heartbeatBackgroundEnabled</code></td><td valign="center" align="left"> |
---|
88 | <p>Enable this flag don't forget to disable the channel heartbeat thread. |
---|
89 | </p> |
---|
90 | </td></tr><tr><td valign="center" align="left"><code>doClusterLog</code></td><td valign="center" align="left"> |
---|
91 | <p><b>Deprecated since 6.0.0</b></p> |
---|
92 | <p>Possible values are <code>true</code> or <code>false</code><br> |
---|
93 | Value is inherited from Tomcat 5.5 and has no official meaning. |
---|
94 | to configure logging, use the standard tomcat logging configuration. |
---|
95 | </p> |
---|
96 | </td></tr><tr><td valign="center" align="left"><code>clusterLogName</code></td><td valign="center" align="left"> |
---|
97 | <p><b>Deprecated since 6.0.0</b></p> |
---|
98 | <p> |
---|
99 | Value is inherited from Tomcat 5.5 and has no official meaning. |
---|
100 | to configure logging, use the standard tomcat logging configuration. |
---|
101 | </p> |
---|
102 | </td></tr></table> |
---|
103 | </blockquote></td></tr></table> |
---|
104 | </blockquote></td></tr></table></td></tr><!--FOOTER SEPARATOR--><tr><td colspan="2"><hr size="1" noshade></td></tr><!--PAGE FOOTER--><tr><td colspan="2"><div align="center"><font size="-1" color="#525D76"><em> |
---|
105 | Copyright © 1999-2008, Apache Software Foundation |
---|
106 | </em></font></div></td></tr></table></body></html> |
---|