Redis MOVED key moved to another node

The key has been moved to another node in the Redis cluster (used in cluster mode).

When encountering the "MOVED key moved to another node" error in Redis, it indicates that the data you are trying to access has been moved to a different node in a Redis Cluster setup. This is a part of Redis Cluster's automatic sharding mechanism. Here is the immediate action you can take:

  1. Use the Redis CLI to Redirect the Request: The MOVED error message includes the address of the node to which the key has been moved. The format of the error is MOVED <hash slot> <hostname>:<port>. You should use this information to connect directly to the correct node. For example, if the error is MOVED 1234 127.0.0.1:6381, connect to the node using Redis CLI with the command redis-cli -h 127.0.0.1 -p 6381 and then execute your command again.
  2. Automatically Handle MOVED with Redis Clients: Most Redis clients have built-in support to handle MOVED errors automatically. Ensure your client is configured correctly to support Redis Cluster. This typically involves setting a cluster mode or similar option in your client's configuration.
  3. Check Cluster Status: To further investigate, you can check the cluster's status and configuration. Connect to any node of the cluster and run CLUSTER NODES or CLUSTER INFO commands. These commands will show you the current configuration and status of the cluster, including which slots are mapped to which nodes. This can help you verify that the cluster is configured correctly and is stable.
  4. Check for Network Issues or Configuration Changes: If the MOVED errors are happening sporadically or have just started occurring, there might be network issues, or a cluster configuration change might be underway. Check for any recent changes in your network configuration or any ongoing maintenance that might affect the cluster's stability.

Execute these actions step by step to understand and mitigate the issue.

Never debug

Redis

manually again

Let Dr. Droid create custom investigation plans for your infrastructure.

Start Free POC (15-min setup) →
Automate Debugging for
Redis
See how Dr. Droid creates investigation plans for your infrastructure.

MORE ISSUES

Made with ❤️ in Bangalore & San Francisco 🏢

Doctor Droid