docker-compose.yml
version: '2'
services:
# master : bitnami/redis:6.2.6
redis-master:
hostname: redis-master
container_name: redis-master
image: bitnami/redis:6.2.6
environment:
- REDIS_REPLICATION_MODE=master
- ALLOW_EMPTY_PASSWORD=yes
ports:
- 6379:6379
# slave1 : bitnami/redis:6.2.6
redis-slave-1:
hostname: redis-slave-1
container_name: redis-slave-1
image: bitnami/redis:6.2.6
environment:
- REDIS_REPLICATION_MODE=slave
- REDIS_MASTER_HOST=redis-master
- ALLOW_EMPTY_PASSWORD=yes
ports:
- 6480:6379
depends_on:
- redis-master
# slave2 : bitnami/redis:6.2.6
redis-slave-2:
hostname: redis-slave-2
container_name: redis-slave-2
image: bitnami/redis:6.2.6
environment:
- REDIS_REPLICATION_MODE=slave
- REDIS_MASTER_HOST=redis-master
- ALLOW_EMPTY_PASSWORD=yes
ports:
- 6481:6379
depends_on:
- redis-master
- redis-slave-1
# sentinel1 : bitnami/redis-sentinel:6.2.6
redis-sentinel-1:
hostname: redis-sentinel-1
container_name: redis-sentinel-1
image: bitnami/redis-sentinel:6.2.6
environment:
- REDIS_SENTINEL_DOWN_AFTER_MILLISECONDS=3000
- REDIS_MASTER_HOST=redis-master
- REDIS_MASTER_PORT_NUMBER=6379
- REDIS_MASTER_SET=master-name
- REDIS_SENTINEL_QUORUM=2
depends_on:
- redis-master
- redis-slave-1
- redis-slave-2
ports:
- 26379:26379
# sentinel2 : bitnami/redis-sentinel:6.2.6
redis-sentinel-2:
hostname: redis-sentinel-2
container_name: redis-sentinel-2
image: bitnami/redis-sentinel:6.2.6
environment:
- REDIS_SENTINEL_DOWN_AFTER_MILLISECONDS=3000
- REDIS_MASTER_HOST=redis-master
- REDIS_MASTER_PORT_NUMBER=6379
- REDIS_MASTER_SET=master-name
- REDIS_SENTINEL_QUORUM=2
depends_on:
- redis-master
- redis-slave-1
- redis-slave-2
ports:
- 26380:26379
# sentinel3 : bitnami/redis-sentinel:6.2.6
redis-sentinel-3:
hostname: redis-sentinel-3
container_name: redis-sentinel-3
image: bitnami/redis-sentinel:6.2.6
environment:
- REDIS_SENTINEL_DOWN_AFTER_MILLISECONDS=3000
- REDIS_MASTER_HOST=redis-master
- REDIS_MASTER_PORT_NUMBER=6379
- REDIS_MASTER_SET=master-name
- REDIS_SENTINEL_QUORUM=2
depends_on:
- redis-master
- redis-slave-1
- redis-slave-2
ports:
- 26381:26379
'Database > Redis' 카테고리의 다른 글
[redis] 레디스에 전체 key 갯수 확인하는 방법 (0) | 2021.12.28 |
---|---|
[redis] 레디스에 key, value 입력하는 방법 (0) | 2021.12.28 |
[redis] docker-compose.yml (마스터1, 슬레이브2, 센티널1) (0) | 2021.12.27 |
[redis] sentinel get-master-addr-by-name master-name 살펴보기 (0) | 2021.12.27 |
[redis] sentinel master master-name 내용 살펴보기 (0) | 2021.12.27 |