1.failoverNodes (optional, must not be used for non-sticky sessions)
This attribute must contain the ids of the memcached nodes,
that shall not be used by this tomcat for session backup, but only if no other memcached nodes are available. Therefore, you should list those memcached nodes, that are running
on the same machine as this tomcat. Several memcached node ids are separated by space or comma. For non-sticky sessions failoverNodes must not be specified as a session is not tied to a single tomcat. For membase buckets this attribute should also be left out.
2.I have several (sticky) tomcats and memcached nodes, how shall I configure failoverNodes for each tomcat?
failoverNodes are for setups where some tomcats and memcacheds are running on the same machine. When the machine serving a tomcat crashes the session can only be served by another tomcat when the session is stored in a memcached running on a different machine. So a tomcat shall write sessions preferrably to memcacheds running on other machines, and store sessions only in a memcached running on the same machine when no other memcached is available. That's the meaning of failoverNodes.
Some examples:
Example
machines m1, m2
tomcats t1, t2 on m1, t3, t4 on m2
memcached nodes n1 on m1, n2 on m2
-> failoverNodes for t1 and t2 = n1, failoverNodes for t3 and t4 = n2
Example
machines m1, m2, m3, m4
tomcats t1 on m1, t2 on m2, t3 on m3 and t4 on m4
memcaches n1 on m1, n2 on m2, n3 on m3, n4 on m4
-> t1.failoverNodes = n1, t2.failoverNodes = n2, t3.failoverNodes = n3, t4.failoverNodes = n4
Example
machines m1, m2, m3, m4
tomcats t1 on m1, t2 on m2
memcacheds n1 on m3, n2 on m4
-> t1.failoverNodes and t2.failoverNodes = <empty> (not needed in this case)
3.How are memcached nodes selected for session backup?
When a new session is created the memcached-session-manager selects the memcached node randomly.
4.session backup
session backup就是在sticky sessions下,把session存储到memcached中,与failoverNodes无关。
分享到:
相关推荐
memcached-1.9.6,libevent-2.1.12-stable.tar memcached-session-manager-1.9.6,msm-kryo-serializer-1.9.6.jar,tomcat8.5,实现会话共享
自测适用于tomcat7,其他tomcat没有测试 asm kryo kryo-serializer kryo-serializers memcached-session-manager memcached-session-manager-tc7 minlog objenesis reflectasm spymemcached
Memcached-session-manager使用说明及相关jar包(tomcat7版) 依照文档部署即可实现多服务器多tomcat session共享,jar包中是tomcat7集成所需要的jar包,序列化工具用的是java默认的序列化工具,若要使用其他版本的...
memcached-session-manager-1.6.5.jar
本lib包包含:javolution-5.5.1.jar、kryo-1.03.jar、kryo-serializers-0.10.jar、memcached-2.5.jar、memcached-session-manager-1.5.1.jar、memcached-session-manager-tc7-1.5.1.jar、minlog-1.2.jar、msm-...
memcached-session-manager-tc6-1.6.3.jar
memcached-session-manager-1.8.1.jar
memcached-session-manager-tc7
memcached-session-manager-1.6.5.jar
完全可以根据github的要求来配置,我只是没分了~ 官网地址:https://github.com/magro/memcached-session-manager/wiki/SetupAndConfiguration#add-memcached-session-manager-jars-to-tomcat
适应MSM的整合包,有 flexjson-3.3 msm-flexjson-serializer-1.9.6 msm-spymemcached-2.11.3 memcached-session-manager-1.9.6 memcached-session-manager-tc8-1.9.6
tomcat-7.0.54配合使用的memcached-session-manager-1.6.1的整套jar包
memcached-session-manager
memcached-session-manager-tc7-1.6.5.jar
网上下载过N种jar版本,启动tomcat报各种错误;浪费了很多时间;本资源经tomcat7、tomcat8测试,均正常实现负载均衡,session共享功能。
memcached-session-manager_4_tomcat8 用在centos7 下的tomcat 8.0.33 java 1.8 测试成功