memcached-session-manager备忘

[b]1.failoverNodes (optional, must not be used for non-sticky sessions)[/b]
This attribute must contain the ids of the memcached nodes, [b][i]that shall not be used by this tomcat for session backup[/i][/b], but only if no other memcached nodes are available. Therefore, you should list those memcached nodes, that are running [b][i]on the same machine[/i][/b] 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.

[b]2.I have several (sticky) tomcats and memcached nodes, how shall I configure failoverNodes for each tomcat?[/b]
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)

[b]3.How are memcached nodes selected for session backup?[/b]
When a new session is created the memcached-session-manager selects the memcached node randomly.

[b]4.session backup[/b]
session backup就是在sticky sessions下,把session存储到memcached中,与failoverNodes无关。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值