Watch 43 Star 83 Fork 35

王政 / memcached.distributedSessionJavaApache-2.0

Sign up for free
Explore and code with more than 2 million developers,Free private repositories !:)
Sign up
基于MemCached的session共享插件,可以使得应用服务器集群通过Memcached集群共享session。目前支持Tomcat6以上版本。 spread retract

Clone or download
Notice: Creating folder will generate an empty file .keep, because not support in Git


Lastest Version:0.1.0-beta


This tool based on MemCached aims to act as a session-share-component for servers, which include Tomcat 6 and all the higher version.And what you really have to do is just write the configuration file and provide the necessary infomation of memcached servers .

Version 0.1.0's features

  1. BackupControlerInf allows you to set backup of sessions.And you can use "backupAmount" attribute to set the amount of backups.
  2. DistributedSessionsConcurrentHashMap allows your application servers regard MemCached Cluster as a giant concurrent hash map.

How to use


Add listed code to $Catalina_Home/conf/context.xml and surround it with "context" tag.

<Manager className="com.ufo5260987423.memcached.distributedSession.manageProxy.TomcatProxy"
nodeName="Jerry" />

And the addresses attribute is the string of MemCached Servers' addresses blanked with spaces.Further more, nodeName is the identifier of tomcat server.

References package

It's necessary to add slf4j-api-1.7.5.jar and xmemcached-2.0.0.jar to $Catalina_Home/lib. Of course you should add this tool to the folder. And please run command "mvn package" in order to compile this jar.


When Compile your own jar,please modify the /src/test/resources/applicationContext.xml for unit test.Or your compile may fail.

Comments ( 0 )

You need to Sign in for post a comment


Help Search