Add nodes, move slots and remove nodes in a cluster (add-node, reshard, rebalance)
RedisClusterCommand
# Add the new master to the cluster (joins empty, with no slots):
redis-cli --cluster add-node node7:6379 node1:6379
# Attach a new replica to a specific master:
redis-cli --cluster add-node node8:6379 node1:6379 --cluster-slave --cluster-master-id <master-node-id>
# Move 1000 slots from all masters to the new node:
redis-cli --cluster reshard node1:6379 --cluster-from all --cluster-to <node7-id> --cluster-slots 1000 --cluster-yes
# Or rebalance automatically (give slots to empty masters too):
redis-cli --cluster rebalance node1:6379 --cluster-use-empty-masters
# Remove a node whose slots have been emptied:
redis-cli --cluster del-node node1:6379 <node-id>What it does
Adds a new master or replica to the cluster, moves slots and their keys between nodes online, rebalances the slot distribution automatically and removes an emptied node from the cluster.
When to use it
When scaling memory/throughput horizontally, spreading the load of a hot node, or decommissioning a node.
Caution
Slot migration transfers keys one by one with MIGRATE; while big keys move, both nodes can block briefly. During migration clients get ASK redirects; a cluster-aware client is required. If a reshard is interrupted, slots stay in migrating/importing state; complete it with --cluster fix. Do not remove a master that still owns slots with del-node; move its slots first.