diff --git a/utils/create-cluster/create-cluster b/utils/create-cluster/create-cluster index d97ee2b9c..dd2008331 100755 --- a/utils/create-cluster/create-cluster +++ b/utils/create-cluster/create-cluster @@ -58,6 +58,23 @@ then exit 0 fi +if [ "$1" == "restart" ] +then + OLD_PORT=$PORT + while [ $((PORT < ENDPORT)) != "0" ]; do + PORT=$((PORT+1)) + echo "Stopping $PORT" + $BIN_PATH/redis-cli -p $PORT shutdown nosave + done + PORT=$OLD_PORT + while [ $((PORT < ENDPORT)) != "0" ]; do + PORT=$((PORT+1)) + echo "Starting $PORT" + $BIN_PATH/redis-server --port $PORT --protected-mode $PROTECTED_MODE --cluster-enabled yes --cluster-config-file nodes-${PORT}.conf --cluster-node-timeout $TIMEOUT --appendonly yes --appendfilename appendonly-${PORT}.aof --appenddirname appendonlydir-${PORT} --dbfilename dump-${PORT}.rdb --logfile ${PORT}.log --daemonize yes ${ADDITIONAL_OPTIONS} + done + exit 0 +fi + if [ "$1" == "watch" ] then PORT=$((PORT+1)) @@ -113,10 +130,11 @@ then exit 0 fi -echo "Usage: $0 [start|create|stop|watch|tail|tailall|clean|clean-logs|call]" +echo "Usage: $0 [start|create|stop|restart|watch|tail|tailall|clean|clean-logs|call]" echo "start -- Launch Redis Cluster instances." echo "create [-f] -- Create a cluster using redis-cli --cluster create." echo "stop -- Stop Redis Cluster instances." +echo "restart -- Restart Redis Cluster instances." echo "watch -- Show CLUSTER NODES output (first 30 lines) of first node." echo "tail -- Run tail -f of instance at base port + ID." echo "tailall -- Run tail -f for all the log files at once."