簡體   English   中英

Redis memory 用法 CLI 在集群上不起作用

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM