-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
63 lines (57 loc) · 1.5 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
version: '3'
services:
redis1:
image: bitnami/redis:latest
environment:
- REDIS_REPLICATION_MODE=master
- ALLOW_EMPTY_PASSWORD=yes
redis2:
image: bitnami/redis:latest
depends_on:
- redis1
environment:
- REDIS_REPLICATION_MODE=slave
- REDIS_MASTER_HOST=redis1
- ALLOW_EMPTY_PASSWORD=yes
redis3:
image: bitnami/redis:latest
depends_on:
- redis1
environment:
- REDIS_REPLICATION_MODE=slave
- REDIS_MASTER_HOST=redis1
- ALLOW_EMPTY_PASSWORD=yes
sentinel:
image: bitnami/redis-sentinel:latest
# deploy:
# replicas: 3
depends_on:
- redis1
- redis2
- redis3
environment:
- REDIS_MASTER_HOST=redis1
# - REDIS_SENTINEL_QUORUM=1
- REDIS_SENTINEL_DOWN_AFTER_MILLISECONDS=5000
- REDIS_SENTINEL_FAILOVER_TIMEOUT=5000
lb:
image: haproxy:2.2-alpine
depends_on:
- redis1
- redis2
- redis3
- sentinel
volumes:
- ./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg
ports:
- '9000:9000'
- '6379:6379'
- '6380:6380'
benchmark:
image: bitnami/redis:latest
command: sh -c "echo check redis1; redis-benchmark -h redis1 -t set,get -q -c 1000; echo check redis2; redis-benchmark -h redis2 -t set,get -q -c 1000; echo check redis3; redis-benchmark -h redis3 -t set,get -q -c 1000; echo check lb; redis-benchmark -h lb -t set,get -q -c 1000"
depends_on:
- redis1
- redis2
- redis3
- lb