cvs commit: jakarta-tomcat-catalina/webapps/docs cluster-howto.xml
pero2005/07/08 13:52:50 Modified:webapps/docs cluster-howto.xml Log: document new resend flag small other changes Revision ChangesPath 1.11 +43 -18jakarta-tomcat-catalina/webapps/docs/cluster-howto.xml Index: cluster-howto.xml === RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/cluster-howto.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- cluster-howto.xml 1 Jul 2005 18:35:03 - 1.10 +++ cluster-howto.xml 8 Jul 2005 20:52:50 - 1.11 @@ -342,8 +342,7 @@ resourceName=UserDatabase /gt; lt;Host name=localhost appBase=webappsgt; - lt;Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster -defaultMode=true /gt; + lt;Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster/gt; lt;/Hostgt; lt;/Enginegt; lt;/Servicegt; @@ -353,7 +352,8 @@ The default mode configuration setup a emfastasyncmode/em cluster configuration with following parameters: ul -liOpen Membership receiver at em228.0.0.4/em and send to multicast udp port em8012/em./li +liOpen Membership receiver at em228.0.0.4/em and send to multicast udp port em8012/em/li +liSend membership every 1 sec and drop member after 30sec./li liOpen message receiver at default ip interface at first free port between em8015/em and em8019/em./li liReceiver message with emSocketReplicationListener/em /li liConfigure a emReplicationTransmitter/em with emfastasyncmode/em sender mode./li @@ -372,8 +372,7 @@ lt;Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster service.mcastBindAddress=127.0.0.1 receiver.tcpListenPort=9070 - receiver.tcpListenMaxPort=9075 - defaultMode=true /gt; + receiver.tcpListenMaxPort=9075 /gt; /source br/ bWARNING/b: When you add you sub elements, there overwrite the defaults complete. @@ -383,8 +382,7 @@ lt;Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster service.mcastBindAddress=127.0.0.1 receiver.tcpListenPort=9070 - receiver.tcpListenMaxPort=9075 - defaultMode=true gt; + receiver.tcpListenMaxPort=9075 gt; lt;ClusterListener className=org.apache.catalina.cluster.session.ClusterSessionListener /gt; lt;ClusterListener className=org.apache.catalina.cluster.session.JvmRouteSessionIDBinderListener /gt; lt;Valve className=org.apache.catalina.cluster.tcp.ReplicationValve @@ -423,8 +421,7 @@ jvmRoute=node1gt; lt;Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase /gt; -lt;Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster -defaultMode=true /gt; +lt;Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster/gt; lt;Host name=localhost appBase=webapps/gt; lt;/Enginegt; @@ -474,7 +471,7 @@ manager.expireSessionsOnShutdown=false manager.notifyListenersOnReplication=false manager.notifySessionListenersOnReplication=false - manager.sendAllSessions=false +manager.sendAllSessions=false manager.sendAllSessionsSize=500 manager.sendAllSessionsWaitTime=20gt; lt;Membership @@ -483,8 +480,8 @@ mcastBindAddress=127.0.0.1 mcastClusterDomain=d10 mcastPort=45564 - mcastFrequency=500 - mcastDropTime=3000/gt; + mcastFrequency=1000 + mcastDropTime=3/gt; lt;Receiver className=org.apache.catalina.cluster.tcp.ReplicationListener tcpListenAddress=auto @@ -566,7 +563,7 @@ tr tdwaitForAck/td tdWait for ack after data send/td -tdcodetrue/code/td +tdcodefalse/code/td /tr tr @@ -583,7 +580,7 @@ /table /p p -Example to get statistic information and transfer is compressedbr/ +Example to get statistic information, wait for ack at every message send and transfer at compressed modebr/ source lt;Sender
Re: cvs commit: jakarta-tomcat-catalina/webapps/docs cluster-howto.xml
Thank-you for your e-mail. Please note that i will be away from the office starting Wednesday June 29th, returning Thursday July 7th, with no access to email. In my absence, kindly contact Cheri Dueck at [EMAIL PROTECTED] Kind Regards, Natasha Hasmani Senior Event Manager - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-catalina/webapps/docs cluster-howto.xml
Thank-you for your e-mail. Please note that i will be away from the office starting Wednesday June 29th, returning Thursday July 7th, with no access to email. In my absence, kindly contact Cheri Dueck at [EMAIL PROTECTED] Kind Regards, Natasha Hasmani Senior Event Manager - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/webapps/docs cluster-howto.xml
pero2005/07/01 11:35:03 Modified:webapps/docs cluster-howto.xml Log: Update docs at engine cluster mode Revision ChangesPath 1.10 +123 -30 jakarta-tomcat-catalina/webapps/docs/cluster-howto.xml Index: cluster-howto.xml === RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/cluster-howto.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- cluster-howto.xml 26 Jun 2005 21:23:36 - 1.9 +++ cluster-howto.xml 1 Jul 2005 18:35:03 - 1.10 @@ -218,6 +218,8 @@ Service | Engine + | \ + | --- Cluster --* | Host | @@ -229,27 +231,47 @@ | \ | -- DeltaManager | - --- - || | \ - Sender Receiver Membership \ - -- Valve - | \ - | -- ReplicationValve - | -- JvmRouteBinderValve - | - -- LifecycleListener - | - -- ClusterListener - | \ - | -- ClusterSessionListener - | -- JvmRouteSessionIDBinderListener - | - -- Deployer -\ - -- FarmWarDeployer + - + | | | \ + ReceiverSender Membership \ + \ -- Valve + -- SocketReplicationListener| \ + -- ReplicationListener | -- ReplicationValve + | -- JvmRouteBinderValve + | + -- LifecycleListener + | + -- ClusterListener + | \ + | -- ClusterSessionListener + | -- JvmRouteSessionIDBinderListener + | + -- Deployer +\ + -- FarmWarDeployer /source +source + Sender +\ +-- ReplicationTransmitter + | + - + \ + IDataSender + \ + | + --- (sync) + | \ + | -- PooledSocketSender (pooled) + | -- SockerSender (synchronous) + | + --- (async) + \ + -- AsyncSocketSender (synchronous) + -- FastAsyncSocketSender (fastasyncqueue) +/source /p /section @@ -375,6 +397,45 @@ /p /section +section name=Simple Engine Cluster Configuration for all hosts +p +Simple one line engine configurationbr/ +source + lt;Server port=8011 + shutdown=SHUTDOWN gt; +lt;GlobalNamingResourcesgt; +lt;Resource name=UserDatabase auth=Container + type=org.apache.catalina.UserDatabase +description=User database that can be updated and saved + factory=org.apache.catalina.users.MemoryUserDatabaseFactory +pathname=conf/tomcat-users.xml /gt; + lt;/GlobalNamingResourcesgt; +lt;Service name=Catalinagt; +lt;Connectorport=9012 + protocol=AJP/1.3 +lt;Connector port=9013 + maxThreads=10 +minSpareThreads=4 +maxSpareThreads=4 +/gt; +lt;Enginename=Catalina + defaultHost=localhost +jvmRoute=node1gt; +lt;Realm className=org.apache.catalina.realm.UserDatabaseRealm + resourceName=UserDatabase /gt; +lt;Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster +defaultMode=true /gt;
cvs commit: jakarta-tomcat-catalina/webapps/docs cluster-howto.xml
pero2005/06/09 13:42:55 Modified:webapps/docs cluster-howto.xml Log: Fix! Revision ChangesPath 1.8 +3 -3 jakarta-tomcat-catalina/webapps/docs/cluster-howto.xml Index: cluster-howto.xml === RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/cluster-howto.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- cluster-howto.xml 9 Jun 2005 20:38:30 - 1.7 +++ cluster-howto.xml 9 Jun 2005 20:42:55 - 1.8 @@ -730,19 +730,19 @@ tr tdClusterSender/td -tdConfiguration and stats of the sender infrastractur/td +tdConfiguration and stats of the sender infrastructure/td tdcodetype=ClusterSender,host=${HOST}/code/td /tr tr tdClusterReceiver/td -tdConfiguration and stats of the recevier infrastractur/td +tdConfiguration and stats of the recevier infrastructure/td tdcodetype=ClusterReceiver,host=${HOST}/code/td /tr tr tdClusterMembership/td -tdConfiguration and stats of the membership infrastractur/td +tdConfiguration and stats of the membership infrastructure/td tdcodetype=ClusterMembership,host=${HOST}/code/td /tr - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/webapps/docs cluster-howto.xml
pero2005/04/29 13:14:58 Modified:webapps/docs cluster-howto.xml Log: Not ready, but add some important information about current cluster modul implementation details. Revision ChangesPath 1.6 +428 -7jakarta-tomcat-catalina/webapps/docs/cluster-howto.xml Index: cluster-howto.xml === RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/cluster-howto.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- cluster-howto.xml 5 Feb 2004 16:05:31 - 1.5 +++ cluster-howto.xml 29 Apr 2005 20:14:58 - 1.6 @@ -8,6 +8,7 @@ properties author email=[EMAIL PROTECTED]Filip Hanik/author +author email=[EMAIL PROTECTED]Peter Rossbach/author titleClustering/Session Replication HOW-TO/title /properties @@ -24,7 +25,9 @@ liUncomment the codeValve(ReplicationValve)/code element in server.xml/li liIf your Tomcat instances are running on the same machine, make sure the codetcpListenPort/code attribute is unique for each instance./li -liMake sure your codeweb.xml/code has the codelt;distributable/gt;/code element/li +liMake sure your codeweb.xml/code has the codelt;distributable/gt;/code element +or set at your codelt;Context distributable=true /gt;/code/li +liMake sure that jvmRoute attribute is set at your Engine codelt;Engine name=Catalina jvmRoute=node1 gt;/code/li /ul pLoad balancing can be achieved through many techniques, as seen in the a href=balancer-howto.htmlLoad Balancing/a chapter./p @@ -38,8 +41,8 @@ pTo enable session replication in Tomcat, three different paths can be followed to achieve the exact same thing:/p ol - liUsing session persistence, and saving the session to a shared file system (PersistenceManager)/li - liUsing session persistence, and saving the session to a shared database (JDBCManager)/li + liUsing session persistence, and saving the session to a shared file system (PersistenceManager + FileStore)/li + liUsing session persistence, and saving the session to a shared database (PersistenceManager + JDBCStore)/li liUsing in-memory-replication, using the SimpleTcpCluster that ships with Tomcat 5 (server/lib/catalina-cluster.jar)/li /ol @@ -47,7 +50,9 @@ This is an algorithm that is only efficient when the clusters are small. For large clusters, the next release will support a primary-secondary session replication where the session will only be stored at one - or maybe two backup servers. + or maybe two backup servers. + Currently you can use the domain worker attribute (mod:_jk gt; 1.2.8) to build cluster partitions + with the potential of very scaleable cluster solution. In order to keep the network traffic down in an all-to-all environment, you can split your cluster into smaller groups. This can be easily achieved by using different multicast addresses for the different groups. A very simple setup would look like this: @@ -66,7 +71,7 @@ pWhat is important to mention here, is that session replication is only the beginning of clustering. Another popular concept used to implement clusters is farming, ie, you deploy your apps only to one server, and the cluster will distribute the deployments across the entire cluster. - This is all capabilities that can go into the next release./p + This is all capabilities that can go into with the FarmWarDeployer (s. cluster example at codeserver.xml/code)/p pIn the next section will go deeper into how session replication works and how to configure it./p /section @@ -259,20 +264,436 @@ request times, and synchronous replication guarantees the session to be replicated before the request returns. /p p -The parameter quot;replicationModequot; has three different settings: quot;pooledquot;, quot;synchronousquot; and quot;asynchronousquot; +The parameter quot;replicationModequot; has four different settings: quot;pooledquot;, quot;synchronousquot;, quot;asynchronousquot; and quot;fastasyncqueuequot; /p + +section name=Cluster Configuration for ReplicationTransmitter +p +List of Attributesbr/ +table border=1 cellpadding=5 + + tr +th align=center bgcolor=aquaAttribute/th +th align=center bgcolor=aquaDescription/th +th align=center bgcolor=aquaDefault value/th + /tr + + tr +tdreplicationMode/td +tdreplication mode (synchronous,pooled.asynchronous,fastasyncqueue) +/td +tdcodepooled/code/td + /tr + + tr +tdprocessSenderFrequency/td +td/td +tdcode2/code/td + /tr + + tr +tdcompress/td +tdcompress bytes before sending (consume memory, but reduce network traffic - GZIP)/td +tdcodefalse/code/td + /tr + + tr +
Re: cvs commit: jakarta-tomcat-catalina/webapps/docs cluster-howto.xml
[EMAIL PROTECTED] wrote: pero2005/04/29 13:14:58 Modified:webapps/docs cluster-howto.xml Log: Not ready, but add some important information about current cluster modul implementation details. Revision ChangesPath 1.6 +428 -7jakarta-tomcat-catalina/webapps/docs/cluster-howto.xml [snip] section name=FAQ pTo be completed once I receive questions about session replication:/p ol -liQ: What happens when I pull the network cord?p/p +liQ: What happens when I pull the network card?p/p Actually, I think this really is supposed to be cord, not card. Maybe replacing it with the word cable would be better? Cheers. -- Jason Brittain - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/webapps/docs cluster-howto.xml
fhanik 2004/01/09 15:36:34 Modified:catalina/src/conf server.xml webapps/docs cluster-howto.xml Log: Set the default replication mode to be pooled, for faster performance Revision ChangesPath 1.28 +3 -2 jakarta-tomcat-catalina/catalina/src/conf/server.xml Index: server.xml === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/conf/server.xml,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- server.xml9 Jan 2004 23:28:23 - 1.27 +++ server.xml9 Jan 2004 23:36:33 - 1.28 @@ -283,15 +283,16 @@ mcastPort=45564 mcastFrequency=500 mcastDropTime=3000 - tcpThreadCount=2 + tcpThreadCount=6 tcpListenAddress=auto tcpListenPort=4001 tcpSelectorTimeout=100 printToScreen=false expireSessionsOnShutdown=false useDirtyFlag=true - replicationMode=synchronous + replicationMode=pooled / + -- !-- When configuring for clustering, you also add in a valve to catch all the requests 1.4 +11 -5 jakarta-tomcat-catalina/webapps/docs/cluster-howto.xml Index: cluster-howto.xml === RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/cluster-howto.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- cluster-howto.xml 22 Dec 2003 15:18:24 - 1.3 +++ cluster-howto.xml 9 Jan 2004 23:36:34 - 1.4 @@ -234,7 +234,6 @@ p The membership is established by all the tomcat instances are sending broadcast messages on the same multicast IP and port. - The TCP listen port, is the port where the session replication is received from other members. /p p @@ -242,18 +241,25 @@ replication. /p p -One of the most important performance considerations is the synchronous versus asynchronous replication +One of the most important performance considerations is the synchronous (pooled or not pooled) versus asynchronous replication mode. In a synchronous replication mode the request doesn't return until the replicated session has been sent over the wire and reinstantiated on all the other cluster nodes. -Using synchronous mode potentially becomes a bottleneck, but is a must if you cant have -sticky sessions, what is recommended here is to increase the number of threads that handle +There are two settings for synchronous replication. Pooled or not pooled. +Not pooled (ie replicationMode=quot;synchronousquot;) means that all the replication request are sent over a single +socket. +Using synchronous mode potentially becomes a bottleneck, +You can overcome this bottleneck by setting replicationMode=quot;pooledquot;. +What is recommended here is to increase the number of threads that handle incoming replication request. This is the tcpThreadCount property in the cluster -section of server.xml. +section of server.xml. The pooled setting means that we are using multiple sockets, hence increases the performance. Asynchronous replication, should be used if you have sticky sessions until fail over, then your replicated data is not time crucial, but the request time is, at this time leave the tcpThreadCount to be number-of-nodes-1. During async replication, the request is returned before the data has been replicated. async replication yields shorter request times, and synchronous replication guarantees the session to be replicated before the request returns. +/p +p +The parameter quot;replicationModequot; has three different settings: quot;pooledquot;, quot;synchronousquot; and quot;asynchronousquot; /p /section - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/webapps/docs cluster-howto.xml
yoavs 2003/12/22 07:18:24 Modified:webapps/docs cluster-howto.xml Log: Added note to clustering about JDK 1.4 requirement. Rememebr to remove this note if clustering code is modified to work on JDK 1.3. Revision ChangesPath 1.3 +1 -0 jakarta-tomcat-catalina/webapps/docs/cluster-howto.xml Index: cluster-howto.xml === RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/cluster-howto.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- cluster-howto.xml 17 Dec 2003 21:00:40 - 1.2 +++ cluster-howto.xml 22 Dec 2003 15:18:24 - 1.3 @@ -30,6 +30,7 @@ as a load balancer. Apache/mod_jk will also do or hardware of course/p pNote: Remember that your session state is tracked by a cookie, so your URL must look the same from the out side otherwise, a new session will be created./p +pNote: Clustering support currently requires the JDK version 1.4 or later./p /section - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/webapps/docs cluster-howto.xml
fhanik 2003/12/17 13:00:40 Modified:webapps/docs cluster-howto.xml Log: added a little note about sync vs async replication. Sync replication is truly working on redhat, somehow windows is giving me problems with NIO when writing the ACK back to the channel Revision ChangesPath 1.2 +42 -29jakarta-tomcat-catalina/webapps/docs/cluster-howto.xml Index: cluster-howto.xml === RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/cluster-howto.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- cluster-howto.xml 15 Oct 2003 01:57:59 - 1.1 +++ cluster-howto.xml 17 Dec 2003 21:00:40 - 1.2 @@ -4,7 +4,7 @@ ] document url=cluster-howto.html -project; +project; properties author email=[EMAIL PROTECTED]Filip Hanik/author @@ -24,7 +24,7 @@ liUncomment the codeValve(ReplicationValve)/code element in server.xml/li liIf your Tomcat instances are running on the same machine, make sure the codetcpListenPort/code attribute is unique for each instance./li -liMake sure your codeweb.xml/code has the codelt;distributable/gt;/code element/li +liMake sure your codeweb.xml/code has the codelt;distributable/gt;/code element/li /ul pThen all you have to do is start Tomcat, I suggest using a href=http://balance.sourceforge.net;Balance/a as a load balancer. Apache/mod_jk will also do or hardware of course/p @@ -43,8 +43,8 @@ /ol pIn this release of session replication, Tomcat performs an all-to-all replication of session state. - - This is an algorithm that is only efficient when the clusters are small. For large clusters, the next + + This is an algorithm that is only efficient when the clusters are small. For large clusters, the next release will support a primary-secondary session replication where the session will only be stored at one or maybe two backup servers. In order to keep the network traffic down in an all-to-all environment, you can split your cluster @@ -63,7 +63,7 @@ /source pWhat is important to mention here, is that session replication is only the beginning of clustering. - Another popular concept used to implement clusters is farming, ie, you deploy your apps only to one + Another popular concept used to implement clusters is farming, ie, you deploy your apps only to one server, and the cluster will distribute the deployments across the entire cluster. This is all capabilities that can go into the next release./p pIn the next section will go deeper into how session replication works and how to configure it./p @@ -74,7 +74,7 @@ pTo make it easy to understand how clustering works, I'm gonna take you through a series of scenarios. In the scenario I only plan to use two tomcat instances codeTomcatA/code and codeTomcatB/code. We will cover the following sequence of events:/p - + ol licodeTomcatA/code starts up/li licodeTomcatB/code starts up/li @@ -105,12 +105,12 @@ p When TomcatB starts up, it follows the same sequence as TomcatA did with one exception. The cluster is started and will establish a membership (TomcatA,TomcatB). -TomcatB will now request the session state from a server that already exists in the cluster, -in this case TomcatA. TomcatA responds to the request, and before TomcatB starts listening +TomcatB will now request the session state from a server that already exists in the cluster, +in this case TomcatA. TomcatA responds to the request, and before TomcatB starts listening for HTTP requests, the state has been transferred from TomcatA to TomcatB. -In case TomcatA doesn't respond, TomcatB will time out after 60 seconds, and issue a log -entry. The session state gets transferred for each web application that has distributable in -its web.xml. Note: To use session replication efficiently, all your tomcat instances should be +In case TomcatA doesn't respond, TomcatB will time out after 60 seconds, and issue a log +entry. The session state gets transferred for each web application that has distributable in +its web.xml. Note: To use session replication efficiently, all your tomcat instances should be configured the same. /pp/p /li @@ -124,17 +124,17 @@ the request returns to the user, back through the valve pipeline. For each request the entire session is replicated, this allows code that modifies attributes in the session without calling setAttribute or removeAttribute to be replicated. -a useDirtyFlag configuration parameter can be used to optimize the number of times -a session is replicated.
cvs commit: jakarta-tomcat-catalina/webapps/docs cluster-howto.xml index.xml project.xml
fhanik 2003/10/14 18:57:59 Modified:webapps/docs index.xml project.xml Added: webapps/docs cluster-howto.xml Log: added in a clustering how to, not yet completed, need to describe the configuration, although it is already done in server.xml Revision ChangesPath 1.11 +3 -0 jakarta-tomcat-catalina/webapps/docs/index.xml Index: index.xml === RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/index.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- index.xml 8 Sep 2003 10:16:02 - 1.10 +++ index.xml 15 Oct 2003 01:57:59 - 1.11 @@ -89,6 +89,9 @@ Configuring MBean descriptors files for custom components./li lia href=default-servlet.htmlstrongDefault Servlet/strong/a - Configuring the default servlet and customizing directory listings./li +lia href=cluster-howto.htmlstrongTomcat Clustering/strong/a - +Enable session replication in a Tomcat environment./li + /ol /section 1.16 +1 -1 jakarta-tomcat-catalina/webapps/docs/project.xml Index: project.xml === RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/project.xml,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- project.xml 8 Sep 2003 10:16:02 - 1.15 +++ project.xml 15 Oct 2003 01:57:59 - 1.16 @@ -36,7 +36,7 @@ item name=16) MBean Descriptor href=mbeans-descriptor-howto.html/ item name=17) Default Servlethref=default-servlet.html/ - +item name=18) Clusteringhref=cluster-howto.html/ /menu menu name=Reference 1.1 jakarta-tomcat-catalina/webapps/docs/cluster-howto.xml Index: cluster-howto.xml === ?xml version=1.0? !DOCTYPE document [ !ENTITY project SYSTEM project.xml ] document url=cluster-howto.html project; properties author email=[EMAIL PROTECTED]Filip Hanik/author titleClustering/Session Replication HOW-TO/title /properties body section name=Quick Start pTo run session replication in your Tomcat 5 container, the following steps should be completed:/p ul liAll your session attributes must implement codejava.io.Serializable/code/li liUncomment the codeCluster/code element in server.xml/li liUncomment the codeValve(ReplicationValve)/code element in server.xml/li liIf your Tomcat instances are running on the same machine, make sure the codetcpListenPort/code attribute is unique for each instance./li liMake sure your codeweb.xml/code has the codelt;distributable/gt;/code element/li /ul pThen all you have to do is start Tomcat, I suggest using a href=http://balance.sourceforge.net;Balance/a as a load balancer. Apache/mod_jk will also do or hardware of course/p pNote: Remember that your session state is tracked by a cookie, so your URL must look the same from the out side otherwise, a new session will be created./p /section section name=Overview pTo enable session replication in Tomcat, three different paths can be followed to achieve the exact same thing:/p ol liUsing session persistence, and saving the session to a shared file system (PersistenceManager)/li liUsing session persistence, and saving the session to a shared database (JDBCManager)/li liUsing in-memory-replication, using the SimpleTcpCluster that ships with Tomcat 5 (server/lib/catalina-cluster.jar)/li /ol pIn this release of session replication, Tomcat performs an all-to-all replication of session state. This is an algorithm that is only efficient when the clusters are small. For large clusters, the next release will support a primary-secondary session replication where the session will only be stored at one or maybe two backup servers. In order to keep the network traffic down in an all-to-all environment, you can split your cluster into smaller groups. This can be easily achieved by using different multicast addresses for the different groups. A very simple setup would look like this: /p source DNS Round Robin | Load Balancer / \ Cluster1 Cluster2 / \/ \ Tomcat1 Tomcat2 Tomcat3 Tomcat4 /source pWhat is important to mention here, is that session replication is only the beginning of clustering. Another popular concept used to implement clusters is farming, ie, you deploy your apps only to one server, and the cluster will distribute the deployments across the entire cluster. This is all capabilities that can go