# MOVED: The key lives on another cluster node

> In Redis Cluster the key's hash slot is owned by a different node, which replies with the slot number and the address that owns it.

Source: https://sqlly.app/errors/redis/moved
Last updated: 2026-11-30
License: Text and data [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) (credit SQLly, sqlly.app); code and SQL snippets [MIT](https://opensource.org/license/mit). [Details](https://sqlly.app/license).
Note: Quoted error message text belongs to its database vendor.

- Error prefix: `MOVED`
- Category: Cluster and replication

Error message:

```text
MOVED 12182 127.0.0.1:7002
```

## What it means

MOVED is how Redis Cluster routes. Every key maps to one of 16384 slots (CRC16 of the key modulo 16384), each slot belongs to exactly one node, and a node that receives a command for a slot it does not own refuses it with MOVED slot host:port, telling the client where the key actually lives.

A cluster-aware client follows the redirect and re-sends to the reported endpoint. You see the error itself when the client is not cluster-aware (plain redis-cli without -c, a naive connection pool), when a resharding changed the slot map and a client has not refreshed yet, or when you point at one node deliberately for debugging. MOVED is normal protocol traffic, not a fault: the command did not run, but the cluster told you exactly where to run it.

## Common causes

- A cluster-unaware client sent the command to a node that does not own the key's slot.
- The slot map changed through resharding or failover, and the client is still using its cached map.
- During maintenance you connected to a single node directly instead of through the cluster.

## Anatomy of a MOVED reply

| | |
| --- | --- |
| MOVED | The prefix: this node refused the command and named the slot's owner. |
| 12182 | The hash slot the key maps to, CRC16 of the key modulo 16384. |
| 127.0.0.1:7002 | The endpoint that owns the slot now; re-send the command there. |

## How to fix it

1. Find which slot the key hashes to, then ask the cluster who owns it:

   ```sql
   redis-cli -p 7000 CLUSTER KEYSLOT foo
   # (integer) 12182
   redis-cli -p 7000 CLUSTER SLOTS
   ```
2. Use a cluster-aware client, or redis-cli with -c, which follows the redirect for you:

   ```sql
   redis-cli -c -p 7000 SET foo bar
   # -> Redirected to slot [12182] located at 127.0.0.1:7002
   # OK
   ```
3. If errors persist after a reshard, force the client to rebuild its slot map by reconnecting; most libraries also refresh on every MOVED they receive.

## Reproduce it safely

```sql
redis-cli --cluster create 127.0.0.1:7000 127.0.0.1:7001 127.0.0.1:7002 --cluster-replicas 0
redis-cli -p 7000 SET foo bar
# (error) MOVED 12182 127.0.0.1:7002
redis-cli -c -p 7000 SET foo bar
# OK (the redirect was followed)
```

## How SQLly helps

SQLly prints the whole MOVED line, slot and target address included, so you can see which node owns the key without running CLUSTER SLOTS first. If you are working node by node, the target node can be added as another SQLly connection and the command retried there.

## Questions

### Is MOVED a problem I need to fix?

Not on its own. Cluster-aware clients follow it automatically. Act only when a client keeps failing: it is not following redirects, or its slot map has gone stale.

### How is the slot number computed?

CRC16 of the key modulo 16384. If the key contains {braces}, only the part inside them is hashed, which is how hash tags pin keys to the same slot.

## Related errors

- [`ASK`](https://sqlly.app/errors/redis/ask): The key is migrating to another node
- [`CROSSSLOT`](https://sqlly.app/errors/redis/crossslot): Multi-key command spans two slots
- [`CLUSTERDOWN`](https://sqlly.app/errors/redis/clusterdown): The cluster cannot serve this slot

The code and message text are from the [Redis documentation and source code](https://redis.io/docs/latest/).
