[英]Redis memory usage CLI does not work on cluster
我使用 go-redis 库检查 memory 在 Redis 集群上对特定密钥的使用情况。 该库偶尔会失败并出现错误“redis:nil”,这通常意味着它访问了错误的 redis 实例以查找密钥。 The go-redis library is using the Redis CLI: "command" to get the list of arguments for each command, and to find where is the redis key position in the arguments list.
特别是对于 memory CLI,“命令”CLI 的 output 是:
157) 1) "memory"
2) (integer) -2
3) 1) readonly
2) random
4) (integer) 0
5) (integer) 0
6) (integer) 0
The Redis document: https://redis.io/commands/command items 4 and 5 are the positions of the first key in arguments, and the last key in arguments.
但值为零? 根据 memory CLI 文档: https://redis.io/commands/memory-usage项目 4 和 5 应该都具有值 3。
这是 redis“命令”CLI 的 output 中的错误,还是我误解了这个?
这是 redis 中的设计问题,请参阅https://github.com/redis/redis/issues/7493
最后的操作是合并拉取请求: https://github.com/go-redis/redis/pull/1400
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.