summaryrefslogtreecommitdiff
path: root/utils/create-cluster
diff options
context:
space:
mode:
authornikhilajayk <nikhilajayk@gmail.com>2019-09-26 21:51:49 +0530
committernikhilajayk <nikhilajayk@gmail.com>2019-09-26 21:51:49 +0530
commit6578119a237426a4092c2fc567bd6f4029af2e61 (patch)
tree36e7a42b4ba529d190a652c7a022fca4e0581b15 /utils/create-cluster
parenteda703ab284f1ce491fb2c376fd08fe8aa956c62 (diff)
downloadredis-6578119a237426a4092c2fc567bd6f4029af2e61.tar.gz
Added cluster host and protected mode variables
Diffstat (limited to 'utils/create-cluster')
-rw-r--r--utils/create-cluster/README2
-rwxr-xr-xutils/create-cluster/create-cluster6
2 files changed, 5 insertions, 3 deletions
diff --git a/utils/create-cluster/README b/utils/create-cluster/README
index e682f6dc9..37a3080db 100644
--- a/utils/create-cluster/README
+++ b/utils/create-cluster/README
@@ -16,7 +16,7 @@ To create a cluster, follow these steps:
number of instances you want to create.
2. Use "./create-cluster start" in order to run the instances.
3. Use "./create-cluster create" in order to execute redis-cli --cluster create, so that
-an actual Redis cluster will be created.
+an actual Redis cluster will be created. (If you're accessing your setup via a local container, ensure that the CLUSTER_HOST value is changed to your local IP)
4. Now you are ready to play with the cluster. AOF files and logs for each instances are created in the current directory.
In order to stop a cluster:
diff --git a/utils/create-cluster/create-cluster b/utils/create-cluster/create-cluster
index 468f924a4..9ffd462ae 100755
--- a/utils/create-cluster/create-cluster
+++ b/utils/create-cluster/create-cluster
@@ -1,10 +1,12 @@
#!/bin/bash
# Settings
+CLUSTER_HOST=127.0.0.1
PORT=30000
TIMEOUT=2000
NODES=6
REPLICAS=1
+PROTECTED_MODE=yes
# You may want to put the above config parameters into config.sh in order to
# override the defaults without modifying this script.
@@ -22,7 +24,7 @@ then
while [ $((PORT < ENDPORT)) != "0" ]; do
PORT=$((PORT+1))
echo "Starting $PORT"
- ../../src/redis-server --port $PORT --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
+ ../../src/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
done
exit 0
fi
@@ -32,7 +34,7 @@ then
HOSTS=""
while [ $((PORT < ENDPORT)) != "0" ]; do
PORT=$((PORT+1))
- HOSTS="$HOSTS 127.0.0.1:$PORT"
+ HOSTS="$HOSTS $CLUSTER_HOST:$PORT"
done
../../src/redis-cli --cluster create $HOSTS --cluster-replicas $REPLICAS
exit 0