redis config_error ai_generated true

ERR 槽 1234 未分配给任何节点

ERR Slot 1234 is not assigned to any node

ID: redis/err-cluster-slot-unassigned

其他格式: JSON · Markdown 中文 · English
85%修复率
86%置信度
1证据数
2024-02-14首次发现

版本兼容性

版本状态引入弃用备注
Redis 7.0.14 active
Redis 7.2.2 active
redis-cli 7.2.2 active

根因分析

在 Redis 集群中,某个哈希槽未分配给任何节点,通常是由于集群初始化不完整、重新分片失败或节点移除后未重新分配槽位。

English

In a Redis Cluster, a hash slot has not been assigned to any node, often due to incomplete cluster initialization, resharding failure, or node removal without reassigning slots.

generic

官方文档

https://redis.io/docs/latest/operate/oss_and_stack/management/scaling/

解决方案

  1. Use redis-cli to fix the slot assignment: `redis-cli --cluster fix <any-node-ip>:6379`. This scans for unassigned slots and reassigns them automatically.
  2. Manually assign the slot to a node using: `redis-cli --cluster addslots <node-ip>:6379 1234` after ensuring the node has the slot range available.
  3. If resharding was interrupted, resume it: `redis-cli --cluster reshard <source-node-ip>:6379 --from <source-node-id> --to <target-node-id> --slots 1234 --yes`

无效尝试

常见但无效的做法:

  1. 99% 失败

    Slots are persisted in cluster configuration, not reset on restart.

  2. 80% 失败

    New nodes need explicit slot assignment via resharding.