This page documents a simple way to get tomcat session replication using Memcached as a backing store, instead of relying on tomcat's own replication (e.g. DeltaManager etc).
In a clustered environment, if a node becomes unavailable, users that were connected to that node will not lose their session, and will not have to log in again. This configuration is completely independent of alfresco clustering itself. It is only related to replicating the application server sessions.
copy all 4 jars in tomcat/lib (on all tomcat nodes). At the time of writing, the latest avaible versions for these jars are 1.2.0 for the couchbase client, 2.10.0 for spymemcached, and 1.6.5 for both memcached-session-manager jars
Session Manager configuration
edit tomcat/conf/context.xml, and add the following lines inside the <Context> tag (on all nodes):
memcached is packaged in all major Linux distributions. you can get it installed with e.g.
yum install memcached
Adjust for other OSes / distributions if required. The default memcached settings don't need to be changed, at least for this example.
load balancer configuration
This is beyond the scope of this wiki page, but here you would configure a load balancer in front of the tomcat instances. Frequently, it is either Apache httpd with either mod_jk or mod_proxy_balancer.
Whichever solution is chosen, do not forget to :
enable sticky sessions (aka sticky routing).
reflect the name of the chosen workers/members in each of the tomcat nodes in conf/server.xml, by adding a jvmRoute attribute in the <Engine> tag. (e.g. jvmRoute='node1' with a worker named node1 for mod_jk, or a balanceMember with route=node1 for mod_proxy_balancer).
Starting the services
start memcache with e.g
service memcached start
start your frontend load balancer (httpd in the example mentionned above)
the tomcat nodes can now be started in turn, using the usual means (e.g. startup scripts, services, ... ). Session information will be replicated through memcached, and users will not have to log in again if the node they're connected to goes down.