Direkt zum Inhalt

Cant't find a way to work around the errors "TYPE returned an error: MOVED" and "Error: MOVED"

0

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.

gefragt vor 4 Jahren1352 Aufrufe

1 Antwort
0

Hello,

It looks like redis cli issue. Here are few recommendations for running bigkeys and hotkeys:

  1. Use the latest stable redis cli release: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/nodes-connecting.html

  2. Use redis-cli connect to the configuration endpoint. Configuration endpoint could be found from cluster details.

  3. Find the **primary nodes **by executing cluster nodes.

$ redis6-cli -c -h <configuration endpoint> -p 6379 --tls

cluster nodes

  1. Run the bigkeys and hotkeys against the node endpoint of individual primary nodes.

$ redis6-cli -c -h <primary node endpoint> -p 6379 --tls --hotkeys

AWS

beantwortet vor 4 Jahren

  • 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.

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.