【问题标题】:Redis Cluster: Is it possible to obtain one hash slot from different keys?Redis Cluster:是否可以从不同的键中获取一个哈希槽?
【发布时间】:2017-03-20 16:25:10
【问题描述】:

我从 Redis 集群教程中了解到,集群只有 16384 个插槽(0 - 16383)。哈希槽通过以下命令计算:CRC16 (KEY) mod 16384。例如,某个键的 CRC16 等于 16385,而哈希槽将是 1。对于另一个密钥 CRC16 等于 32769 并且哈希槽将再次为 1。会不会引起一些冲突?还是第一个会被第二个重写?

【问题讨论】:

    标签: redis redis-cluster


    【解决方案1】:

    如果我理解你的问题,不,这不是冲突。每个 key 都属于一个 hashsolt,但每个 hashslot 可以有多个 key。

    CLUSTER GETKEYSINSLOT slot count:https://redis.io/commands/cluster-keyslot

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-27
      • 1970-01-01
      • 2014-06-17
      • 2020-10-13
      相关资源
      最近更新 更多