使用memcache 管理session
一、下载下列几个 Jar包
http://memcached-session-manager.googlecode.com/files/memcached-session-manager-1.3.0.jar
http://memcached-session-manager.googlecode.com/files/msm-javolution-serializer-jodatime-1.3.0.jar
http://memcached-session-manager.googlecode.com/files/msm-javolution-serializer-cglib-1.3.0.jar
http://spymemcached.googlecode.com/files/memcached-2.4.2.jar
http://memcached-session-manager.googlecode.com/files/javolution-5.4.3.1.jar
将以下几个Jar包Copy到 $TOMCAT_HOME/lib目下,每个Tomcat节点都需要有。
二、配置Tomcat的Server.xml配置文件,样本可以点击这里下载,主要内容如下:
http://www.javabloger.com/images/2010-05/webcluster/server.xml.txt
?<Context docBase="D:\webapp" path="" reloadable="true" >?
?<Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager"?
???? memcachedNodes="n1:localhost:11211"?
???? requestUriIgnorePattern=".*\.(png|gif|jpg|css|js)$"?
???? sessionBackupAsync="false"?
???? sessionBackupTimeout="100"?
??? transcoderFactorysrc="/img/2012/06/27/0714037210.jpg">
?
?
转载http://www.javabloger.com/article/ngixn-j2ee-tomcat-memcache-session-share.html