[root@server2ROOT]# cd /usr/local/tomcat/lib
[root@server2mnt]# ls /mnt/update/ #先前下载好的包
asm-3.2.jar minlog-1.2.jar
kryo-1.04.jar msm-kryo-serializer-1.6.3.jar
kryo-serializers-0.10.jar reflectasm-1.01.jar
memcached-session-manager-1.6.3.jar spymemcached-2.7.3.jar
memcached-session-manager-tc7-1.6.3.jar
[root@server2mnt]# cd /usr/local/tomcat/lib/
[root@server2lib]# mv /mnt/update/* . #将包移动到指定路径
[root@server2lib]# ls
annotations-api.jar memcached-session-manager-tc7-1.6.3.jar
asm-3.2.jar minlog-1.2.jar
catalina-ant.jar msm-kryo-serializer-1.6.3.jar
catalina-ha.jar reflectasm-1.01.jar
catalina.jar servlet-api.jar
catalina-tribes.jar spymemcached-2.7.3.jar
ecj-4.2.1.jar tomcat-api.jar
el-api.jar tomcat-coyote.jar
jasper-el.jar tomcat-dbcp.jar
jasper.jar tomcat-i18n-es.jar
jsp-api.jar tomcat-i18n-fr.jar
kryo-1.04.jar tomcat-i18n-ja.jar
kryo-serializers-0.10.jar tomcat-jdbc.jar
memcached-session-manager-1.6.3.jar tomcat-util.jar
[root@server2lib]# cd ..
UsingCATALINA_BASE: /usr/local/tomcat
UsingCATALINA_HOME: /usr/local/tomcat
UsingCATALINA_TMPDIR: /usr/local/tomcat/temp
UsingJRE_HOME: /usr/local/java
UsingCLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
[root@server2tomcat]# vim conf/context.xml #添加节点及节点失效后该怎么存储
34 <ManagerclassName="de.javakaffee.web.msm.MemcachedBackupSessionManager"
35memcachedNodes="n1:172.25.29.2:11211,n2:172.25.29.3:11211" #结点
36 failoverNodes="n1" #当n2失效时存储到n1上
37requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$"
38transcoderFactoryClass="de.javakaffee.web.msm.serializer.kryo.KryoTranscoderF actory"
39 />
[root@server2tomcat]# bin/startup.sh #开启Tomcat
服务端3和服务端2的配置基本相同唯一不同的是上面提到的/usr/local/tomcat/conf/context.xml里的36行把“n1”改成“n2”可以用scp传过去再做修改。
2.测试
测试 172.25.29.1/test.jsp
添加用户
添加完成
添加3个用户