mirror of
https://github.com/boostorg/redis.git
synced 2026-01-19 04:42:09 +00:00
Adds Sentinel support (#345)
close #237 close #269 close #268 close #229
This commit is contained in:
committed by
GitHub
parent
00f3ec9b78
commit
bdd9c327c1
@@ -1,19 +1,140 @@
|
||||
services:
|
||||
redis:
|
||||
redis-master:
|
||||
container_name: redis-master
|
||||
image: ${SERVER_IMAGE}
|
||||
entrypoint: "/docker/entrypoint.sh"
|
||||
network_mode: host
|
||||
command: >
|
||||
sh -c 'chmod 777 /tmp/redis-socks &&
|
||||
redis-server \
|
||||
--replica-announce-ip localhost \
|
||||
--port 6379 \
|
||||
--tls-port 16379 \
|
||||
--tls-cert-file /docker/tls/server.crt \
|
||||
--tls-key-file /docker/tls/server.key \
|
||||
--tls-ca-cert-file /docker/tls/ca.crt \
|
||||
--tls-auth-clients no \
|
||||
--unixsocket /tmp/redis-socks/redis.sock \
|
||||
--unixsocketperm 777'
|
||||
volumes:
|
||||
- ./docker:/docker
|
||||
- /tmp/redis-socks:/tmp/redis-socks
|
||||
ports:
|
||||
- 6379:6379
|
||||
- 6380:6380
|
||||
|
||||
redis-replica-1:
|
||||
container_name: redis-replica-1
|
||||
image: ${SERVER_IMAGE}
|
||||
network_mode: host
|
||||
command:
|
||||
[
|
||||
"redis-server",
|
||||
"--replica-announce-ip", "localhost",
|
||||
"--replicaof", "localhost", "6379",
|
||||
"--port", "6380",
|
||||
"--tls-port", "16380",
|
||||
"--tls-cert-file", "/docker/tls/server.crt",
|
||||
"--tls-key-file", "/docker/tls/server.key",
|
||||
"--tls-ca-cert-file", "/docker/tls/ca.crt",
|
||||
"--tls-auth-clients", "no",
|
||||
]
|
||||
volumes:
|
||||
- ./docker:/docker
|
||||
|
||||
|
||||
redis-replica-2:
|
||||
container_name: redis-replica-2
|
||||
image: ${SERVER_IMAGE}
|
||||
network_mode: host
|
||||
command:
|
||||
[
|
||||
"redis-server",
|
||||
"--replica-announce-ip", "localhost",
|
||||
"--replicaof", "localhost", "6379",
|
||||
"--port", "6381",
|
||||
"--tls-port", "16381",
|
||||
"--tls-cert-file", "/docker/tls/server.crt",
|
||||
"--tls-key-file", "/docker/tls/server.key",
|
||||
"--tls-ca-cert-file", "/docker/tls/ca.crt",
|
||||
"--tls-auth-clients", "no",
|
||||
]
|
||||
volumes:
|
||||
- ./docker:/docker
|
||||
|
||||
|
||||
sentinel-1:
|
||||
container_name: sentinel-1
|
||||
image: ${SERVER_IMAGE}
|
||||
network_mode: host
|
||||
command: >
|
||||
sh -c 'cat << EOF > /etc/sentinel.conf && redis-sentinel /etc/sentinel.conf
|
||||
port 26379
|
||||
tls-port 36379
|
||||
tls-cert-file /docker/tls/server.crt
|
||||
tls-key-file /docker/tls/server.key
|
||||
tls-ca-cert-file /docker/tls/ca.crt
|
||||
tls-auth-clients no
|
||||
sentinel resolve-hostnames yes
|
||||
sentinel announce-hostnames yes
|
||||
sentinel announce-ip localhost
|
||||
sentinel monitor mymaster localhost 6379 2
|
||||
sentinel down-after-milliseconds mymaster 10000
|
||||
sentinel failover-timeout mymaster 10000
|
||||
sentinel parallel-syncs mymaster 1
|
||||
EOF'
|
||||
volumes:
|
||||
- ./docker:/docker
|
||||
|
||||
|
||||
sentinel-2:
|
||||
container_name: sentinel-2
|
||||
image: ${SERVER_IMAGE}
|
||||
network_mode: host
|
||||
command: >
|
||||
sh -c 'cat << EOF > /etc/sentinel.conf && redis-sentinel /etc/sentinel.conf
|
||||
port 26380
|
||||
tls-port 36380
|
||||
tls-cert-file /docker/tls/server.crt
|
||||
tls-key-file /docker/tls/server.key
|
||||
tls-ca-cert-file /docker/tls/ca.crt
|
||||
tls-auth-clients no
|
||||
sentinel resolve-hostnames yes
|
||||
sentinel announce-hostnames yes
|
||||
sentinel announce-ip localhost
|
||||
sentinel monitor mymaster localhost 6379 2
|
||||
sentinel down-after-milliseconds mymaster 10000
|
||||
sentinel failover-timeout mymaster 10000
|
||||
sentinel parallel-syncs mymaster 1
|
||||
EOF'
|
||||
volumes:
|
||||
- ./docker:/docker
|
||||
|
||||
sentinel-3:
|
||||
container_name: sentinel-3
|
||||
image: ${SERVER_IMAGE}
|
||||
network_mode: host
|
||||
command: >
|
||||
sh -c 'cat << EOF > /etc/sentinel.conf && redis-sentinel /etc/sentinel.conf
|
||||
port 26381
|
||||
tls-port 36381
|
||||
tls-cert-file /docker/tls/server.crt
|
||||
tls-key-file /docker/tls/server.key
|
||||
tls-ca-cert-file /docker/tls/ca.crt
|
||||
tls-auth-clients no
|
||||
sentinel resolve-hostnames yes
|
||||
sentinel announce-hostnames yes
|
||||
sentinel announce-ip localhost
|
||||
sentinel monitor mymaster localhost 6379 2
|
||||
sentinel down-after-milliseconds mymaster 10000
|
||||
sentinel failover-timeout mymaster 10000
|
||||
sentinel parallel-syncs mymaster 1
|
||||
EOF'
|
||||
volumes:
|
||||
- ./docker:/docker
|
||||
|
||||
|
||||
builder:
|
||||
image: ${BUILDER_IMAGE}
|
||||
container_name: builder
|
||||
image: ${BUILDER_IMAGE}
|
||||
network_mode: host
|
||||
tty: true
|
||||
environment:
|
||||
- BOOST_REDIS_TEST_SERVER=redis
|
||||
volumes:
|
||||
- ../:/boost-redis
|
||||
- /tmp/redis-socks:/tmp/redis-socks
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/bin/sh
|
||||
# The Redis container entrypoint. Runs the server with the required
|
||||
# flags and makes the socket accessible
|
||||
|
||||
set -e
|
||||
|
||||
chmod 777 /tmp/redis-socks
|
||||
|
||||
redis-server \
|
||||
--tls-port 6380 \
|
||||
--tls-cert-file /docker/tls/server.crt \
|
||||
--tls-key-file /docker/tls/server.key \
|
||||
--tls-ca-cert-file /docker/tls/ca.crt \
|
||||
--tls-auth-clients no \
|
||||
--unixsocket /tmp/redis-socks/redis.sock \
|
||||
--unixsocketperm 777
|
||||
Reference in New Issue
Block a user