Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A tomcat session manager that backups sessions in memcached and pulls them from there if asked for unknown sessions
Java Ruby

This branch is even with magro:javolution-jodatime

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
core/src
doc
etc
javolution-serializer-jodatime
javolution-serializer
lib
xstream-serializer
.gitignore
README
buildfile

README

This project uses buildr for build management. Have a look at http://buildr.apache.org
for how to install buildr (the "Getting started" section should be fine).

== Build the sources ==
$ buildr package

== Installation ==
Copy the created memcached-session-manager-1.0.jar from the target
directory to $CATALINA_HOME/libs, and lib/* as well.

Notice: this project is running against/with tomcat6, I have not tested it with
other versions of tomcat.

== Configuration ==
In the server.xml (or the context.xml) add an appropriate <Manager/> element to
your context, so that this looks like this:

<Context path="/hunter">
    <Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
        memcachedNodes="n1:localhost:11211 n2:localhost:11212" failoverNodes="n2"
        requestUriIgnorePattern=".*\.(png|gif|jpg|css|js)$" />
</Context>

You can use several failoverNodes seperated by comma.

== Run / Test ==
Startup two memcached nodes (or a single one, but then you also must change the
configuration shown above) and two tomcats behind an apache/loadbalancer.

You should  be able to use the tomcat examples or just deploy an application
of yourself. Then make a request that creates a session. Afterwards shut down
the tomcat on which the session was created and see that the session is taken
over by the second tomcat.

Now relax or go and grab a coffee :)
Something went wrong with that request. Please try again.