add sentinel + correction ninegate/nineskeletor + add nine pull
This commit is contained in:
parent
071919ad82
commit
701e30433e
|
@ -0,0 +1,19 @@
|
|||
FROM redis:6-alpine
|
||||
|
||||
ENV SENTINEL_QUORUM 2
|
||||
ENV SENTINEL_DOWN_AFTER 1000
|
||||
ENV SENTINEL_FAILOVER 1000
|
||||
|
||||
RUN mkdir -p /redis
|
||||
|
||||
WORKDIR /redis
|
||||
|
||||
COPY sentinel.conf .
|
||||
COPY sentinel-entrypoint.sh /usr/local/bin/
|
||||
|
||||
RUN chown redis:redis /redis/* && \
|
||||
chmod +x /usr/local/bin/sentinel-entrypoint.sh
|
||||
|
||||
EXPOSE 26379
|
||||
|
||||
ENTRYPOINT ["sentinel-entrypoint.sh"]
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
sed -i "s/\$SENTINEL_QUORUM/$SENTINEL_QUORUM/g" /redis/sentinel.conf
|
||||
sed -i "s/\$SENTINEL_DOWN_AFTER/$SENTINEL_DOWN_AFTER/g" /redis/sentinel.conf
|
||||
sed -i "s/\$SENTINEL_FAILOVER/$SENTINEL_FAILOVER/g" /redis/sentinel.conf
|
||||
|
||||
redis-server /redis/sentinel.conf --sentinel
|
|
@ -0,0 +1,9 @@
|
|||
port 26379
|
||||
|
||||
dir /tmp
|
||||
|
||||
sentinel resolve-hostnames yes
|
||||
sentinel monitor redismaster redis 6379 $SENTINEL_QUORUM
|
||||
sentinel down-after-milliseconds redismaster $SENTINEL_DOWN_AFTER
|
||||
sentinel parallel-syncs redismaster 1
|
||||
sentinel failover-timeout redismaster $SENTINEL_FAILOVER
|
|
@ -0,0 +1,11 @@
|
|||
services:
|
||||
# Sentinel
|
||||
# Sentinel du servince redis
|
||||
# Port interne 26379
|
||||
sentinel:
|
||||
image: reg.cadoles.com/envole/sentinel
|
||||
container_name: nine-sentinel
|
||||
env_file: ./services/35-sentinel/env/.env.merge
|
||||
networks:
|
||||
- nine-network
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
|
||||
# == SENTINEL ================================================================================================================================
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
#!/bin/bash
|
||||
|
||||
function upsentinel {
|
||||
if [[ $SENTINEL_ACTIVATE == 1 && $SENTINEL_LOCAL == 1 ]]
|
||||
then
|
||||
Title "SENTINEL"
|
||||
EchoVert "CONTAINER"
|
||||
upservice $SENTINEL_SERVICE_NAME
|
||||
Echo
|
||||
fi
|
||||
}
|
||||
|
||||
function destroysentinel(){
|
||||
if [[ $SENTINEL_LOCAL == 1 ]]
|
||||
then
|
||||
Title "DESTROY $SENTINEL_SERVICE_NAME"
|
||||
|
||||
stop $SENTINEL_SERVICE_NAME 1
|
||||
docker-compose rm -s -v -f "$SENTINEL_SERVICE_NAME"
|
||||
|
||||
echo ""
|
||||
fi
|
||||
}
|
Loading…
Reference in New Issue