-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose.yml
99 lines (96 loc) · 2.29 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
version: "3.9"
services:
master-node:
image: "${IMAGE}"
container_name: "master"
cap_add:
- SYS_RESOURCE
healthcheck:
test: ["CMD", "curl", "-k", "https://localhost:9443"]
interval: 5s
timeout: 2s
retries: 3
ports:
- "12000:12000"
- "9443:9443"
- "8443:8443"
- "6379:6379"
- "6372:6378"
environment:
- RE_USERNAME=${RE_USERNAME}
- RE_PASS=${RE_PASS}
- RE_CLUSTER_NAME=${RE_CLUSTER_NAME}
- RE_DB_PORT=${RE_DB_PORT}
- RE_USE_OSS_CLUSTER=${RE_USE_OSS_CLUSTER}
volumes:
- "$PWD/setup_cluster.sh:/opt/setup_cluster.sh"
- "$PWD/create_db.sh:/opt/create_db.sh"
networks:
cluster:
ipv4_address: 172.28.5.2
node-1:
image: "${IMAGE}"
container_name: "slave-1"
cap_add:
- SYS_RESOURCE
depends_on:
master-node:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-k", "https://localhost:9443"]
interval: 5s
timeout: 2s
retries: 3
ports:
- "12001:12000"
- "9444:9443"
- "8444:8443"
- "6373:6378"
environment:
- RE_USERNAME=${RE_USERNAME}
- RE_PASS=${RE_PASS}
- RE_CLUSTER_NAME=${RE_CLUSTER_NAME}
- RE_DB_PORT=${RE_DB_PORT}
- RE_USE_OSS_CLUSTER=${RE_USE_OSS_CLUSTER}
volumes:
- "$PWD/join_node.sh:/opt/join_node.sh"
networks:
cluster:
ipv4_address: 172.28.5.3
node-2:
image: "${IMAGE}"
container_name: "slave-2"
cap_add:
- SYS_RESOURCE
depends_on:
node-1:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-k", "https://localhost:9443"]
interval: 5s
timeout: 2s
retries: 3
ports:
- "12002:12000"
- "9445:9443"
- "8445:8443"
- "6374:6378"
environment:
- RE_USERNAME=${RE_USERNAME}
- RE_PASS=${RE_PASS}
- RE_CLUSTER_NAME=${RE_CLUSTER_NAME}
- RE_DB_PORT=${RE_DB_PORT}
- RE_USE_OSS_CLUSTER=${RE_USE_OSS_CLUSTER}
volumes:
- "$PWD/join_node.sh:/opt/join_node.sh"
networks:
cluster:
ipv4_address: 172.28.5.4
networks:
cluster:
ipam:
driver: default
config:
- subnet: 172.28.0.0/16
ip_range: 172.28.5.0/24
gateway: 172.28.5.254