I have an AWS Elasticache for Redis configured with cluster mode enabled, using multi az and with 5 shards and 3 nodes (1 primary and 2 replicas). The eviction algorithm is volatile-lfu
From an EC2 instance running the latest Amazon Linux 2023, I'm trying to collect the hotkey and bigkeys data using redis-cli but I'm unable to get the desired results:
- Using
--hotkeys command line parameter
~> redis6-cli -c -h mycluster.cache.amazonaws.com -p 6379 --tls --hotkeys
# Scanning the entire keyspace to find hot keys as well as
# average sizes per key type. You can use -i 0.1 to sleep 0.1 sec
# per 100 SCAN commands (not usually needed).
Error: MOVED 6787 node.mycluster.cache.amazonaws.com:6379
- Using
--bigkeys command line parameter
~> redis6-cli -c -h mycluster.cache.amazonaws.com -p 6379 --tls --bigkeys
# Scanning the entire keyspace to find hot keys as well as
# average sizes per key type. You can use -i 0.1 to sleep 0.1 sec
# per 100 SCAN commands (not usually needed).
TYPE returned an error: MOVED 6787 node.mycluster.cache.amazonaws.com:6379
I did a lot of research on the errors above and all i can find is that you should use the -c command line switch to enable redis-cli to follow the MOVED errors/messages, but as can be seen, I'm using it.
The REPL works just fine for get, set and delete keys. I tried to use --scan parameter and it also worked.
For all my tests I'm using the configuration endpoint. I will test the primary node endpoint recommendation
Well, with the cluster mode enabled, there is no concept of primary node endpoint. Based on the following documentation: Redis (cluster mode enabled) clusters with replicas, because they have multiple shards (API/CLI: node groups), which mean they also have multiple primary nodes, have a different endpoint structure than Redis (cluster mode disabled) clusters. Redis (cluster mode enabled) has a configuration endpoint which "knows" all the primary and node endpoints in the cluster.