how to add a lot of slots to one node at a time

1,565 views
Skip to first unread message

Freire Zhu

unread,
Jan 20, 2015, 3:50:26 AM1/20/15
to redi...@googlegroups.com
Hi everyone, the command CLUSTER ADDSLOTS can add some slots to one node, but how can I add a batch of slots to a node in one time, like I specify the start slot and end slot, then the command could add all slots in the interval?

thanks a lot in advance.

Josiah Carlson

unread,
Jan 20, 2015, 1:18:57 PM1/20/15
to redi...@googlegroups.com
If you want to add slots to a cluster node, you have to explicitly add all slots, there is no "add this range of slots" command. But the CLUSTER ADDSLOTS command *does* let you add multiple slots at the same time...

CLUSTER ADDSLOTS 1 2 3 4

You should be able to add all slots in more or less one go, depending on how many slots you want to assign.

 - Josiah


On Tue, Jan 20, 2015 at 12:50 AM, Freire Zhu <zpf...@gmail.com> wrote:
Hi everyone, the command CLUSTER ADDSLOTS can add some slots to one node, but how can I add a batch of slots to a node in one time, like I specify the start slot and end slot, then the command could add all slots in the interval?

thanks a lot in advance.

--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at http://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.

Michael

unread,
Nov 23, 2015, 6:36:34 AM11/23/15
to Redis DB
I have met the same probles, so I just wort it out by following command: 
first=`echo {0..5000}` # you can insert your own start and end numbers
redis
-cli -a kimi -p 30002 cluster  addslots $first




在 2015年1月20日星期二 UTC+8下午4:50:26,Freire Zhu写道:

Николай Данилов

unread,
Sep 24, 2020, 8:59:10 AM9/24/20
to Redis DB
To do as mentioned, there is a simpler command:
redis-cli -a kimi -p 30002 CLUSTER ADDSLOTS $(seq 0 5000)

But in any case, you'll get an error if even one slot is assigned before.
So, you need a cycle for adding slot one-by-one, excepting ones assigned before.
Reply all
Reply to author
Forward
0 new messages