ASK: ASK slot ip:port(集群重定向)
Redis含义
在 Redis Cluster 中,某个槽正在迁移到另一个节点,所请求的键可能暂时位于目标节点上。服务器仅针对本次请求将客户端重定向到目标节点(临时重定向)。
原因
在 resharding 期间访问正在迁移的槽中已经转移的键。与 MOVED 不同,它不是永久性的;只在当时生效。
解决方法
支持集群的客户端会自动处理 ASK 重定向:向目标节点发送 ASKING 命令并重试请求,但不会永久更新槽映射。使用合适的客户端库,redis-cli 使用 -c 参数。resharding 完成后,重定向会变为永久性的 MOVED。
同一数据库的其他条目
- MISCONFMISCONF Redis is configured to save RDB snapshots, but it's currently unable to persist to disk(Redis 已配置为保存 RDB 快照,但当前无法持久化到磁盘)
- CROSSSLOTCROSSSLOT Keys in request don't hash to the same slot(请求中的键未哈希到同一槽)
- MOVEDMOVED slot ip:port(集群重定向)
- NOSCRIPTNOSCRIPT No matching script. Please use EVAL(没有匹配的脚本。请使用 EVAL)
- EXECABORTEXECABORT Transaction discarded because of previous errors(由于之前的错误,事务已被丢弃)
- NOPERMNOPERM this user has no permissions to run the command or access one of the keys(该用户无权运行此命令或访问其中某个键)
- ERR value is not an integer or out of rangeERR value is not an integer or out of range(值不是整数或超出范围)