`
dean_liu
  • 浏览: 76218 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

memcached-session-manager备忘

    博客分类:
  • Java
 
阅读更多
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无关。
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics