summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBinbin <binloveplay1314@qq.com>2022-02-07 13:58:15 +0800
committerGitHub <noreply@github.com>2022-02-07 07:58:15 +0200
commitc5e3d135ae640027d388a4d98bc16cf0b5dbf789 (patch)
tree3679335d97eec17da5da344b05baed395e42d16a
parentd6e9cde595de635b9f895a978b5c79e8996f66db (diff)
downloadredis-c5e3d135ae640027d388a4d98bc16cf0b5dbf789.tar.gz
create-cluster clean now will clean appendonlydir (#10223)
In #9788, now we stores all persistent append-only files in a dedicated directory. The name of the directory is determined by the appenddirname configuration parameter in redis.conf. Now each node have a separate folder. Update create-cluster clean to clean this default directory.
-rwxr-xr-xutils/create-cluster/create-cluster15
1 files changed, 10 insertions, 5 deletions
diff --git a/utils/create-cluster/create-cluster b/utils/create-cluster/create-cluster
index 729666830..d97ee2b9c 100755
--- a/utils/create-cluster/create-cluster
+++ b/utils/create-cluster/create-cluster
@@ -28,7 +28,7 @@ then
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 --dbfilename dump-${PORT}.rdb --logfile ${PORT}.log --daemonize yes ${ADDITIONAL_OPTIONS}
+ $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
@@ -95,20 +95,25 @@ fi
if [ "$1" == "clean" ]
then
+ echo "Cleaning *.log"
rm -rf *.log
- rm -rf appendonly*.aof
- rm -rf dump*.rdb
- rm -rf nodes*.conf
+ echo "Cleaning appendonlydir-*"
+ rm -rf appendonlydir-*
+ echo "Cleaning dump-*.rdb"
+ rm -rf dump-*.rdb
+ echo "Cleaning nodes-*.conf"
+ rm -rf nodes-*.conf
exit 0
fi
if [ "$1" == "clean-logs" ]
then
+ echo "Cleaning *.log"
rm -rf *.log
exit 0
fi
-echo "Usage: $0 [start|create|stop|watch|tail|clean|call]"
+echo "Usage: $0 [start|create|stop|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."