shell> mkdir jar
shell> cd jar
shell> wget http://repo1.maven.org/maven2/de/javakaffee/msm/memcached-session-manager/1.9.7/memcached-session-manager-1.9.7.jar
shell> wget http://repo1.maven.org/maven2/de/javakaffee/msm/memcached-session-manager-tc8/1.9.7/memcached-session-manager-tc8-1.9.7.jar
shell> wget http://repo1.maven.org/maven2/net/spy/spymemcached/2.11.1/spyme.mcached-2.11.1.jar
shell> wget http://repo1.maven.org/maven2/de/javakaffee/msm/msm-javolution-serializer/1.9.7/msm-javolution-serializer-1.9.7.jar
shell> wget http://repo1.maven.org/maven2/de/javakaffee/msm/msm-xstream-serializer/1.9.7/msm-xstream-serializer-1.9.7.jar
shell> wget http://repo1.maven.org/maven2/com/thoughtworks/xstream/xstream/1.4.9/xstream-1.4.9.jar
shell> wget https://repo.maven.apache.org/maven2/javolution/javolution/5.4.3/javolution-5.4.3.jar
shell> cp *.jar $CATALINA_HOME/lib
# 配置tomcat
shell> vi $CATALINA_HOME/conf/context.xml
<Context>
<Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
memcachedNodes="n1:localhost:11211"
failoverNodes="n1"
requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$" transcoderFactoryClass="de.javakaffee.web.msm.serializer.javolution.Javolu tionTranscoderFactory"/>
// 下面是注释failoverNodes的
<Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
memcachedNodes="n1:localhost:11211"
#failoverNodes="n1"
requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$" transcoderFactoryClass="de.javakaffee.web.msm.serializer.javolution.Javolu tionTranscoderFactory"/>
</Context>
# 配置log
shell> vi $CATALINA_HOME/conf/logging.properties
# de.javakaffee.web.msm.level = FINE
# net.spy.memcached.level = WARNING
shell> vi $CATALINA_HOME/bin/catalina.sh
# CATALINA_OPTS="-Dnet.spy.log.LoggerImpl=net.spy.memcached.compat.log.SunLogger"