CLUSTER FORGET
CLUSTER FORGET node-id
- Group
- Cluster
- Complexity
- O(1)
- Arity
- 3 (exactly, counting the command name)
- HotKV Cloud
- Not available
- On-Premise
- no license needed
CLUSTER FORGET removes a node from the receiving node’s list of known
nodes. The forgotten node’s slots become unassigned here, its link is
closed, and any slot migration to or from it ends. For the next 60 seconds (cluster-blacklist-ttl)
this node ignores what it hears about the forgotten node, and it tells the
other nodes to forget it too, so the node does not come back through gossip
while you remove it everywhere.
To take a node out of a cluster, move its slots away first, then run
CLUSTER FORGET for it on every remaining node within that minute.
redis-cli --cluster del-node does this for you.
Return value
Section titled “Return value”Simple string OK in RESP2 and RESP3, or one of these errors:
| Case | Error |
|---|---|
| No such node (and not forgotten in the last minute) | ERR Unknown node <node-id> |
| The node’s own ID | ERR I tried hard but I can't forget myself... |
| A replica’s own primary | ERR Can't forget my master! |
| Cluster mode is off | ERR This instance has cluster support disabled |
Running CLUSTER FORGET again for a node that another node already made
this one forget replies OK.
Examples
Section titled “Examples”127.0.0.1:6379> CLUSTER FORGET 087d5d8db5c8df0f3152afcd17b94d5879f9107fOK127.0.0.1:6379> CLUSTER FORGET b4240bf759694b9ba85b3b5efd51785b86261c3e(error) ERR I tried hard but I can't forget myself...Compatibility
Section titled “Compatibility”Same behaviour, 60-second ban and error strings as Redis 7 and Valkey 8.
See also
Section titled “See also”CLUSTER MEET, CLUSTER NODES, CLUSTER RESET, Scaling a cluster
Was this page helpful?
Thanks for the feedback.