Skip to content

Redis rebalance - slot migration process

1. source node

cluster setslot {slot} importing {sourceNodeId}

2. target node

cluster setslot {slot} migrating {targetNodeId}

3. source node

cluster getkeysinslot {slot} {count}

4. source node

migrate {targetIp} {targetPort} "" 0 {timeout} keys {keys...}

5. repeat 3 and 4

repeat 3 and 4 until get nothing from getkeysinslot

6. all master nodes

cluster setslot {slot} node {targetNodeId}

Disclaimer
  1. License under CC BY-NC 4.0
  2. Copyright issue feedback me#imzye.me, replace # with @
  3. Not all the commands and scripts are tested in production environment, use at your own risk
  4. No privacy information is collected here
Try my iOS App