go-redis icon indicating copy to clipboard operation
go-redis copied to clipboard

How to migrate slot (CLUSTER SETSLOT)

Open zuosc opened this issue 7 years ago • 3 comments

this is doc: https://redis.io/commands/cluster-setslot#redis-cluster-live-resharding-explained

I want to migrate some slots from one to another.

before:

 cluster nodes
43a1af446b289000fb2d187215eeceab356efa86 10.100.203.165:7002 master - 0 1536142793128 2 connected 10922-16383
659c45f1be91a41bbcacc895e500e39aff4b767e 10.100.203.165:7000 myself,master - 0 0 1 connected 0-5460
ab58196edbfb0861fd73846353e464c30ae2cabb 10.100.203.165:7001 master - 0 1536142794131 0 connected 5461-10921

I want :

 cluster nodes
43a1af446b289000fb2d187215eeceab356efa86 10.100.203.165:7002 master - 0 1536142793128 2 connected 10922-16383
659c45f1be91a41bbcacc895e500e39aff4b767e 10.100.203.165:7000 myself,master - 0 0 1 connected 0-8000
ab58196edbfb0861fd73846353e464c30ae2cabb 10.100.203.165:7001 master - 0 1536142794131 0 connected 8001-10921

And I do not find any function can use, like CLUSTER SETSLOT IMPORTING MIGRATING and so on.

So, how to do it?

thanks!

zuosc avatar Sep 05 '18 10:09 zuosc

We should add that function to the commands list but for now you can use:

client.Do("cluster", "setslot", slot, "importing", node).Err()

vmihailenco avatar Sep 06 '18 11:09 vmihailenco

@vmihailenco OK Thanks!

zuosc avatar Sep 06 '18 14:09 zuosc

This issue is marked stale. It will be closed in 30 days if it is not updated.

github-actions[bot] avatar May 03 '24 00:05 github-actions[bot]