cluster-migrateslots.3valkey - Man Page

Migrate the given slots from this node to the specified nodes.

Synopsis

CLUSTER MIGRATESLOTS SLOTSRANGE start-slot end-slot [start-slot end-slot ...] NODE node-id [SLOTSRANGE start-slot end-slot [start-slot end-slot ...] NODE node-id ...]

Description

CLUSTER MIGRATESLOTS initiates an asynchronous migration of the designated slot range(s) to the specified target node using valkey-atomic-slot-migration(7).

This command allows for many slot ranges in a single migration through repeated start and end slot pairs within the SLOTSRANGE block. It also supports multiple migrations in one command, through repeated SLOTSRANGE and NODE blocks. For example:

CLUSTER MIGRATESLOTS SLOTSRANGE 0 9 20 29 NODE <target A> SLOTSRANGE 10 19 NODE <target B>

Initiates two slot migration jobs, one to <target A> with 20 slots (0-9 inclusive, 20-29 inclusive) and another to <target B> with 10 slots (10-19 inclusive).

OK is returned if all slot migrations are successfully initiated, otherwise an error message is returned and no slot migrations are initiated.

To check on the progress of the slot migration, use the valkey-cluster-getslotmigrations(7) CLUSTER GETSLOTMIGRATIONS command.

Complexity

O(N) where N is the total number of the slots between all start slot and end slot arguments.

Acl Categories

@admin @dangerous @slow

History

See Also

asking(3valkey), cluster(3valkey), cluster-addslots(3valkey), cluster-addslotsrange(3valkey), cluster-bumpepoch(3valkey), cluster-cancelslotmigrations(3valkey), cluster-count-failure-reports(3valkey), cluster-countkeysinslot(3valkey), cluster-delslots(3valkey), cluster-delslotsrange(3valkey), cluster-failover(3valkey), cluster-flushslots(3valkey), cluster-forget(3valkey), cluster-getkeysinslot(3valkey), cluster-getslotmigrations(3valkey), cluster-help(3valkey), cluster-info(3valkey), cluster-keyslot(3valkey), cluster-links(3valkey), cluster-meet(3valkey), cluster-myid(3valkey), cluster-myshardid(3valkey), cluster-nodes(3valkey), cluster-replicas(3valkey), cluster-replicate(3valkey), cluster-reset(3valkey), cluster-saveconfig(3valkey), cluster-set-config-epoch(3valkey), cluster-setslot(3valkey), cluster-shards(3valkey), cluster-slot-stats(3valkey), cluster-slots(3valkey), cluster-syncslots(3valkey), readonly(3valkey), readwrite(3valkey)

Info

2025-10-21 9.0.0 Valkey Command Manual