Files
sa-charts/docker-swarm/redis-prod-50/docker-compose.yml
marsal b2eb2928d8 swarm
2024-10-21 13:29:47 +08:00

117 lines
2.8 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

version: '3.8'
networks:
default:
name: ${NAMESPACE}
external: true
services:
master:
image: 'bitnami/redis:7.0.11'
environment:
- TZ=Asia/Shanghai
- REDIS_MASTER_HOST=192.168.10.4
- REDIS_REPLICATION_MODE=slave
- REDIS_MASTER_PASSWORD=${REDIS_PASSWORD}
- REDIS_PASSWORD=${REDIS_PASSWORD}
- REDIS_REPLICA_IP=192.168.10.55
ports:
- mode: host
protocol: tcp
published: 6379
target: 6379
volumes:
- data_master:/bitnami
deploy:
update_config:
order: stop-first
placement:
constraints:
- node.hostname==ZD-CRM5
slave:
image: 'bitnami/redis:7.0.11'
environment:
- TZ=Asia/Shanghai
- REDIS_REPLICATION_MODE=slave
- REDIS_MASTER_HOST=192.168.10.4
- REDIS_MASTER_PASSWORD=${REDIS_PASSWORD}
- REDIS_PASSWORD=${REDIS_PASSWORD}
- REDIS_REPLICA_IP=192.168.10.56
ports:
- mode: host
protocol: tcp
published: 6379
target: 6379
depends_on:
- master
volumes:
- data_slave:/bitnami
deploy:
update_config:
order: stop-first
placement:
constraints:
- node.hostname==ZD-CRM6
sentinel-1:
image: 'bitnami/redis-sentinel:7.0.11'
environment:
- TZ=Asia/Shanghai
- REDIS_MASTER_HOST=192.168.10.4
- REDIS_MASTER_PASSWORD=${REDIS_PASSWORD}
- REDIS_SENTINEL_ANNOUNCE_IP=192.168.10.55
- REDIS_PASSWORD=${REDIS_PASSWORD}
- REDIS_SENTINEL_PASSWORD=${REDIS_SENTINEL_PASSWORD}
depends_on:
- master
- slave
ports:
- mode: host
protocol: tcp
published: 26379
target: 26379
deploy:
update_config:
order: stop-first
mode: replicated
replicas: 1 # replicas模式 副本数目为1
placement:
constraints:
- node.hostname==ZD-CRM5
volumes:
- data_sentinel_1:/bitnami
sentinel-2:
image: 'bitnami/redis-sentinel:7.0.11'
environment:
- TZ=Asia/Shanghai
- REDIS_MASTER_HOST=192.168.10.4
- REDIS_MASTER_PASSWORD=${REDIS_PASSWORD}
- REDIS_SENTINEL_ANNOUNCE_IP=192.168.10.56
- REDIS_PASSWORD=${REDIS_PASSWORD}
- REDIS_SENTINEL_PASSWORD=${REDIS_SENTINEL_PASSWORD}
depends_on:
- master
- slave
ports:
- mode: host
protocol: tcp
published: 26379
target: 26379
deploy:
update_config:
order: stop-first
mode: replicated
replicas: 1 # replicas模式 副本数目为1
placement:
constraints:
- node.hostname==ZD-CRM6
volumes:
- data_sentinel_2:/bitnami
volumes:
data_sentinel_1:
driver: local
data_sentinel_2:
driver: local
data_master:
driver: local
data_slave:
driver: local