Redis集群中给节点批量指定slot脚本
#!/bin/sh
# 起始槽
begin_slot=$1
# 终点槽
end_slot=$2
# ip
m_host=$3
# 端口
m_port=$4
for((i=$begin_slot;i<=$end_slot;i++));
do
m_slot="${m_slot} ${i}"
done
echo “add slots from ${begin_slot} to ${end_slot}!”
redis-cli -h ${m_host} -p ${m_port} cluster addslots ${m_slot}
查看redis状态
redis-cli --cluster check 127.0.0.1:7000