Added cluster host and protected mode variables
This commit is contained in:
parent
eda703ab28
commit
6578119a23
@ -16,7 +16,7 @@ To create a cluster, follow these steps:
|
|||||||
number of instances you want to create.
|
number of instances you want to create.
|
||||||
2. Use "./create-cluster start" in order to run the instances.
|
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
|
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.
|
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:
|
In order to stop a cluster:
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Settings
|
# Settings
|
||||||
|
CLUSTER_HOST=127.0.0.1
|
||||||
PORT=30000
|
PORT=30000
|
||||||
TIMEOUT=2000
|
TIMEOUT=2000
|
||||||
NODES=6
|
NODES=6
|
||||||
REPLICAS=1
|
REPLICAS=1
|
||||||
|
PROTECTED_MODE=yes
|
||||||
|
|
||||||
# You may want to put the above config parameters into config.sh in order to
|
# You may want to put the above config parameters into config.sh in order to
|
||||||
# override the defaults without modifying this script.
|
# override the defaults without modifying this script.
|
||||||
@ -22,7 +24,7 @@ then
|
|||||||
while [ $((PORT < ENDPORT)) != "0" ]; do
|
while [ $((PORT < ENDPORT)) != "0" ]; do
|
||||||
PORT=$((PORT+1))
|
PORT=$((PORT+1))
|
||||||
echo "Starting $PORT"
|
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
|
done
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
@ -32,7 +34,7 @@ then
|
|||||||
HOSTS=""
|
HOSTS=""
|
||||||
while [ $((PORT < ENDPORT)) != "0" ]; do
|
while [ $((PORT < ENDPORT)) != "0" ]; do
|
||||||
PORT=$((PORT+1))
|
PORT=$((PORT+1))
|
||||||
HOSTS="$HOSTS 127.0.0.1:$PORT"
|
HOSTS="$HOSTS $CLUSTER_HOST:$PORT"
|
||||||
done
|
done
|
||||||
../../src/redis-cli --cluster create $HOSTS --cluster-replicas $REPLICAS
|
../../src/redis-cli --cluster create $HOSTS --cluster-replicas $REPLICAS
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user