标签:lnmp tomcat nginx memcached
【server1】
vim /usr/local/lnmp/tomcat/conf/context.xml
<Context>
......
<Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
memcachedNodes="n1:172.25.45.1:11211,n2:172.25.45.2:11211"
failoverNodes="n1"
requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$"
transcoderFactoryClass="de.javakaffee.web.msm.serializer.kryo.KryoTranscoderFactory"
/>
</Context>
【server2】
vim /usr/local/tomcat/conf/context.xml
将failoverNodes的值改为n2
【server1】
cd /usr/local/lnmp/tomcat/lib
rm -rf memcached-session-manager-tc6-1.6.3.jar
cd ..
bin/shutdown.sh
bin/startup.sh
tail logs/catalina.out
【server2】
yum install memcached
/etc/init.d/memcached start
【server1】
bin/shutdown.sh
bin/startup.sh
tail logs/catalina.out
【server2】
bin/startup.sh
tail logs/catalina.out
yum install telnet
当执行 /etc/init.d/memcached stop 才会改变为n2
避免数据丢失
(八)企业部分之lnmp:nginx+tomcat+memcached
标签:lnmp tomcat nginx memcached
原文地址:http://wjl19940429.blog.51cto.com/11354210/1788985