Skip to content

Instantly share code, notes, and snippets.

@habil
Created February 5, 2019 11:13
Show Gist options
  • Save habil/f9f9bf39c79d702e89ee8d980070e93b to your computer and use it in GitHub Desktop.
Save habil/f9f9bf39c79d702e89ee8d980070e93b to your computer and use it in GitHub Desktop.
Create Redis Slot
#!/bin/bash
ip=$1
counter=$2
end=-1
if [ -z ${3+x} ];
then
end=16383
echo "max slot not specified. auto set to 16383";
else
end=$3
fi
while [ $counter -le $end ]
do
redis-cli CLUSTER ADDSLOTS $counter > /dev/null
echo $ip $counter / $end
((counter++))
done
echo All done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment