gpt4 book ai didi

java - 使用 spymemcached 和 HashAlgorithm.KETAMA_HASH 时如何处理恢复 memcached 节点

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:21:50 24 4
gpt4 key购买 nike

我正在使用 spymemcached 和 HashAlgorithm.KETAMA_HASH 连接到 5 个节点的 memcached 池。

我的理解是,当我们使用一致的哈希算法时,例如,当节点关闭时,我们无需担心,因为 key 将被重新分发(影响最小)

如果宕机节点要加入池怎么办。我需要做什么?

我是否应该确保需要删除陈旧数据?或者我的程序是否需要针对这种情况进行特殊处理?

最佳答案

鉴于此文档是准确的:http://info.couchbase.com/rs/northscale/images/Couchbase_WP_Dealing_with_Memcached_Challenges.pdf

If there is any network disruption, and one or more clients decide that a particular memcached server is not available anymore, they will automatically rehash some data into the rest of the nodes even if the original one is still available. If the node eventually returns to service (for example after the network outage is resolved), the data on that node will be out of date and the clients without updated key-server remapping info will read stale data.

假设这仍然是最新的:http://lists.danga.com/pipermail/memcached/2007-April/003852.html在将节点添加回去之前刷新/刷新节点是安全的。强制关闭的节点清除任何陈旧的条目。

关于java - 使用 spymemcached 和 HashAlgorithm.KETAMA_HASH 时如何处理恢复 memcached 节点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17975889/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com