-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
83 lines (77 loc) · 3.08 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
services:
redis-master-1:
container_name: redis-master-1
platform: linux/arm64 # m1 MacOS의 경우
image: redis:7.2
# network_mode: "host"
command: ["redis-server", "--port", "6379", "--cluster-enabled", "yes", "--cluster-config-file", "nodes.conf", "--cluster-node-timeout", "5000", "--appendonly", "yes"]
restart: always
ports:
- 6379:6379
redis-master-2:
container_name: redis-master-2
platform: linux/arm64 # m1 MacOS의 경우
image: redis:7.2
# network_mode: "host"
command: ["redis-server", "--port", "6479", "--cluster-enabled", "yes", "--cluster-config-file", "nodes.conf", "--cluster-node-timeout", "5000", "--appendonly", "yes"]
restart: always
ports:
- 6479:6479
redis-master-3:
container_name: redis-master-3
platform: linux/arm64 # m1 MacOS의 경우
image: redis:7.2
# network_mode: "host"
command: ["redis-server", "--port", "6579", "--cluster-enabled", "yes", "--cluster-config-file", "nodes.conf", "--cluster-node-timeout", "5000", "--appendonly", "yes"]
restart: always
ports:
- 6579:6579
redis-slave-1:
container_name: redis-slave-1
platform: linux/arm64 # m1 MacOS의 경우
image: redis:7.2
# network_mode: "host"
command: ["redis-server", "--port", "6380", "--cluster-enabled", "yes", "--cluster-config-file", "nodes.conf", "--cluster-node-timeout", "5000", "--appendonly", "yes"]
restart: always
ports:
- 6380:6380
redis-slave-2:
container_name: redis-slave-2
platform: linux/arm64 # m1 MacOS의 경우
image: redis:7.2
# network_mode: "host"
command: ["redis-server", "--port", "6480", "--cluster-enabled", "yes", "--cluster-config-file", "nodes.conf", "--cluster-node-timeout", "5000", "--appendonly", "yes"]
restart: always
ports:
- 6480:6480
redis-slave-3:
container_name: redis-slave-3
platform: linux/arm64 # 맥북인 경우에 activate, 윈도우인 경우 deactivate
image: redis:7.2
# network_mode: "host"
command: ["redis-server", "--port", "6580", "--cluster-enabled", "yes", "--cluster-config-file", "nodes.conf", "--cluster-node-timeout", "5000", "--appendonly", "yes"]
restart: always
ports:
- 6580:6580
redis-cluster-entry:
container_name: redis-cluster-entry
platform: linux/arm64 # m1 MacOS의 경우
image: redis:7.2
# network_mode: "host"
command:
- bash
- -c
- |
redis-cli --cluster create 127.0.0.1:6379 127.0.0.1:6479 127.0.0.1:6579 --cluster-yes
redis-cli --cluster add-node 127.0.0.1:6380 127.0.0.1:6379 --cluster-slave
redis-cli --cluster add-node 127.0.0.1:6480 127.0.0.1:6479 --cluster-slave
redis-cli --cluster add-node 127.0.0.1:6580 127.0.0.1:6579 --cluster-slave
# command: redis-cli --cluster create 127.0.0.1:6379 127.0.0.1:6479 127.0.0.1:6579 127.0.0.1:6380 127.0.0.1:6480 127.0.0.1:6580 --cluster-replicas 1 --cluster-yes
depends_on:
- redis-master-1
- redis-master-2
- redis-master-3
- redis-slave-1
- redis-slave-2
- redis-slave-3
restart: always