mirror of
https://ops.gitlab.net/gitlab-org/gitlab-build-images.git
synced 2025-12-09 18:12:55 +01:00
24 lines
614 B
Bash
Executable file
24 lines
614 B
Bash
Executable file
#!/bin/bash
|
|
|
|
# Approach references https://docs.docker.com/config/containers/multi-service_container/#use-a-wrapper-script
|
|
# This script starts 3 Redis server process in the background and syncs them after a short wait.
|
|
|
|
start_redis_server() {
|
|
redis-server --port $1\
|
|
--cluster-enabled yes \
|
|
--cluster-node-timeout 5000 \
|
|
--bind 0.0.0.0 \
|
|
--cluster-config-file "$2" &
|
|
}
|
|
|
|
start_redis_server 7001 nodes-1.conf
|
|
start_redis_server 7002 nodes-2.conf
|
|
start_redis_server 7003 nodes-3.conf
|
|
|
|
sleep 3
|
|
|
|
redis-cli --cluster create 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003 --cluster-yes
|
|
|
|
wait -n
|
|
|
|
exit $?
|