Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions 5.0/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
set -e

supervisor_conf=/supervisord.conf
tmpcommand="sh -c 'sleep 3 && echo yes | redis-cli --cluster create --cluster-replicas 1 127.0.0.1:7000 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005'"
if [ "x$CLUSTER_PASS" != "x" ]; then
tmpcommand="sh -c 'sleep 3 && echo yes | redis-cli -a $CLUSTER_PASS --cluster create --cluster-replicas 1 127.0.0.1:7000 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005'"
fi

echo "
[supervisord]
nodaemon=true

[program:redis-cluster-create]
command=sh -c 'sleep 3 && echo yes | redis-cli --cluster create --cluster-replicas 1 127.0.0.1:7000 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005'
command=$tmpcommand
autorestart=false
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
Expand All @@ -26,13 +29,20 @@ do
chown redis:redis $data_dir
echo "
cluster-enabled yes
cluster-node-timeout 5000
cluster-node-timeout 15000
cluster-config-file nodes.conf
appendonly yes
port $p
dir $data_dir
cluster-announce-ip $CLUSTER_ANNOUNCE_IP" > $conf_path

if [ "x$CLUSTER_PASS" != "x" ]; then
echo "
requirepass $CLUSTER_PASS
masterauth $CLUSTER_PASS
" >> $conf_path
fi

echo "
[program:redis-$p]
command=redis-server $conf_path
Expand Down