The official documentation is at: http://docs.alfresco.com
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.
<Manager className='de.javakaffee.web.msm.MemcachedBackupSessionManager'
memcachedNodes='n1:localhost:11211'
requestUriIgnorePattern='.*\.(ico|png|gif|jpg|css|js)$' />
All the parameters are documented here , if required.
11211 is the default port memcached starts on. More complex configurations are not required for this simple working example.
This could be considered optional, but keeps the logging to a minimum to avoid flooding the logs.
# A handler's log level threshold can be set using SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST or ALL
net.spy.memcached.level = WARNING
de.javakaffee.web.msm.level = WARNING
-Dnet.spy.log.LoggerImpl=net.spy.memcached.compat.log.SunLogger'
(see Logging config for more details).
The tomcat instances are now configured.
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.
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 :
service memcached start
This configuration can be tested by :
Note : failover stats are also exposed as JMX, see https://code.google.com/p/memcached-session-manager/wiki/JMXStatistics.
Note : more detailed logging can be obtained by adjusting the logging configuration mentionned above.
Note : original instructions used are available here : http://www.bradchen.com/blog/2012/12/tomcat-auto-failover-using-apache-memcached.
Note : A single memcached instance is used here for the example. Memcached itself could be made HA.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.