Hi All,
Here are the few basic steps that you need to follow in order to achieve the in-memory session replication between two or more Tomcat 6 instances.
This blog refers the Apache Tomcat documentation as found here: http://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html.
The Tomcat documentation provides more detailed explanation of the Clustering concepts as well as the definition of tags, attributes etc. used in server.xml file.
Step 1: Include the <distributable> tag in web.xml file i.e. you can simple write the following line in your deployment descriptor(i.e. web.xml):
<distributable />
Please read the following link to know more about this tag: http://wiki.metawerx.net/wiki/Web.xml.Distributable
Step 2: Add the following lines of XML in the server.xml file inside the <Engine> element/tag:
<Engine name="Catalina" defaultHost="localhost"> <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster" channelSendOptions="8"> <Manager className="org.apache.catalina.ha.session.DeltaManager" expireSessionsOnShutdown="false" notifyListenersOnReplication="true"/> <Channel className="org.apache.catalina.tribes.group.GroupChannel"> <Membership className="org.apache.catalina.tribes.membership.McastService" address="228.0.0.4" port="45564" frequency="500" dropTime="3000"/> <Receiver className="org.apache.catalina.tribes.transport.nio.NioReceiver" address="auto" port="4000" autoBind="100" selectorTimeout="5000" maxThreads="6"/> <Sender className="org.apache.catalina.tribes.transport.ReplicationTransmitter"> <Transport className="org.apache.catalina.tribes.transport.nio.PooledParallelSender"/> </Sender> <Interceptor className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"/> <Interceptor className="org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor"/> </Channel> <Valve className="org.apache.catalina.ha.tcp.ReplicationValve" filter=""/> <Valve className="org.apache.catalina.ha.session.JvmRouteBinderValve"/> <Deployer className="org.apache.catalina.ha.deploy.FarmWarDeployer" tempDir="/tmp/war-temp/" deployDir="/tmp/war-deploy/" watchDir="/tmp/war-listen/" watchEnabled="false"/> <ClusterListener className="org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener"/> <ClusterListener className="org.apache.catalina.ha.session.ClusterSessionListener"/> </Cluster> . . . . </Engine>
Please note that there might be some other elements such as <Host>, <Realm> etc. inside the <Engine> element. Also, for each tomcat instance the value defined for the ‘port’ attribute of the <Receiver> tag must be unique.
And, that’s all. You now have a basic session-replication in place. Your sessions are replicated amongst all the tomcat instances which are part of your cluster.
NOTE: Please make sure if you make any changes to the “context.xml” file, you have to delete the following xml file located in the <TOMCAT_HOME>/conf/Catalina/localhost/{yourAppName}.xml. If you don’t delete this file, then your changes will be ignored and the settings defined in this file will take effect.
Cheers!!!
Abhishek Tejpaul
abhishek@intelligrape.com
[Intelligrape Software Pvt. Ltd.]

Memory exercises increase brain power because in your conscious mind you can only work with what you can remember. Intelligence without memory is like a builder without tools. What could he build?. . The simplest memory exercise is to start telling yourself to remember. If you just learned a person’s name, for example, tell yourself, “remember that”. This signals the unconscious mind to rank this input higher in importance.. . Other good memory exercises involve telling yourself why you want to remember something, and how you will remember it. If you just learned a person’s name, think about how that person will be important to you in the future, where you are likely to see them next, and anything you notice about them. Clearly seeing the importance of remembering will motivate the brain to retain the name, and the additional associations in the brain (where you expect to see the person next, for example) fix the name even more firmly in your memory.
This is my first time go to see at here and i am genuinely impressed
to read all at single place.
Hi there, i read your blog from time to time and i own a similar one and i was
just curious if you get a lot of spam responses? If
so how do you reduce it, any plugin or anything you can advise?
I get so much lately it’s driving me mad so any help is very much appreciated.
You’ve made some good points there. I looked on the internet to learn more about the issue and found most individuals will go along with your views on this web site.
Write more, thats all I have to say. Literally, it seems as though
you relied on the video to make your point. You obviously know
what youre talking about, why throw away your intelligence on just posting videos to your blog when you could be giving us something informative to
read?
Wow, marvelous blog layout! How long have you been blogging for?
you made blogging look easy. The overall look of your web site is excellent, as well as the content!
Fantastic beat ! I wish to apprentice while you amend your site, how could i
subscribe for a blog web site? The account
aided me a applicable deal. I had been a little bit acquainted of this your broadcast provided shiny clear
concept