-
Notifications
You must be signed in to change notification settings - Fork 618
Expand file tree
/
Copy pathdocker-compose-3pd-3store-3server.yml
More file actions
202 lines (186 loc) · 5.99 KB
/
Copy pathdocker-compose-3pd-3store-3server.yml
File metadata and controls
202 lines (186 loc) · 5.99 KB
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: hugegraph-3x3
networks:
hg-net:
driver: bridge
volumes:
hg-pd0-data:
hg-pd1-data:
hg-pd2-data:
hg-store0-data:
hg-store1-data:
hg-store2-data:
# ── Shared service defaults ──────────────────────────────────────────
x-pd-common: &pd-common
image: hugegraph/pd:${HUGEGRAPH_VERSION:-latest}
pull_policy: missing
restart: unless-stopped
networks: [hg-net]
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:8620/v1/health >/dev/null || exit 1"]
interval: 15s
timeout: 10s
retries: 30
start_period: 120s
x-store-common: &store-common
image: hugegraph/store:${HUGEGRAPH_VERSION:-latest}
pull_policy: missing
restart: unless-stopped
networks: [hg-net]
depends_on:
pd0: { condition: service_healthy }
pd1: { condition: service_healthy }
pd2: { condition: service_healthy }
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:8520/v1/health >/dev/null || exit 1"]
interval: 15s
timeout: 15s
retries: 40
start_period: 120s
x-server-common: &server-common
image: hugegraph/server:${HUGEGRAPH_VERSION:-latest}
pull_policy: missing
restart: unless-stopped
networks: [hg-net]
depends_on:
store0: { condition: service_healthy }
store1: { condition: service_healthy }
store2: { condition: service_healthy }
environment:
STORE_REST: store0:8520
HG_SERVER_BACKEND: hstore
HG_SERVER_PD_PEERS: pd0:8686,pd1:8686,pd2:8686
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:8080/versions >/dev/null || exit 1"]
interval: 10s
timeout: 5s
retries: 30
start_period: 60s
# ── Services ──────────────────────────────────────────────────────────
services:
# --- PD cluster (3 nodes) ---
pd0:
<<: *pd-common
container_name: hg-pd0
hostname: pd0
networks: [ hg-net ]
environment:
HG_PD_GRPC_HOST: pd0
HG_PD_GRPC_PORT: "8686"
HG_PD_REST_PORT: "8620"
HG_PD_RAFT_ADDRESS: pd0:8610
HG_PD_RAFT_PEERS_LIST: pd0:8610,pd1:8610,pd2:8610
HG_PD_INITIAL_STORE_LIST: store0:8500,store1:8500,store2:8500
HG_PD_DATA_PATH: /hugegraph-pd/pd_data
HG_PD_INITIAL_STORE_COUNT: 3
ports: ["8620:8620", "8686:8686"]
volumes:
- hg-pd0-data:/hugegraph-pd/pd_data
pd1:
<<: *pd-common
container_name: hg-pd1
hostname: pd1
networks: [ hg-net ]
environment:
HG_PD_GRPC_HOST: pd1
HG_PD_GRPC_PORT: "8686"
HG_PD_REST_PORT: "8620"
HG_PD_RAFT_ADDRESS: pd1:8610
HG_PD_RAFT_PEERS_LIST: pd0:8610,pd1:8610,pd2:8610
HG_PD_INITIAL_STORE_LIST: store0:8500,store1:8500,store2:8500
HG_PD_DATA_PATH: /hugegraph-pd/pd_data
HG_PD_INITIAL_STORE_COUNT: 3
ports: ["8621:8620", "8687:8686"]
volumes:
- hg-pd1-data:/hugegraph-pd/pd_data
pd2:
<<: *pd-common
container_name: hg-pd2
hostname: pd2
networks: [ hg-net ]
environment:
HG_PD_GRPC_HOST: pd2
HG_PD_GRPC_PORT: "8686"
HG_PD_REST_PORT: "8620"
HG_PD_RAFT_ADDRESS: pd2:8610
HG_PD_RAFT_PEERS_LIST: pd0:8610,pd1:8610,pd2:8610
HG_PD_INITIAL_STORE_LIST: store0:8500,store1:8500,store2:8500
HG_PD_DATA_PATH: /hugegraph-pd/pd_data
HG_PD_INITIAL_STORE_COUNT: 3
ports: ["8622:8620", "8688:8686"]
volumes:
- hg-pd2-data:/hugegraph-pd/pd_data
# --- Store cluster (3 nodes) ---
store0:
<<: *store-common
container_name: hg-store0
hostname: store0
environment:
HG_STORE_PD_ADDRESS: pd0:8686,pd1:8686,pd2:8686
HG_STORE_GRPC_HOST: store0
HG_STORE_GRPC_PORT: "8500"
HG_STORE_REST_PORT: "8520"
HG_STORE_RAFT_ADDRESS: store0:8510
HG_STORE_DATA_PATH: /hugegraph-store/storage
ports: ["8500:8500", "8510:8510", "8520:8520"]
volumes:
- hg-store0-data:/hugegraph-store/storage
store1:
<<: *store-common
container_name: hg-store1
hostname: store1
environment:
HG_STORE_PD_ADDRESS: pd0:8686,pd1:8686,pd2:8686
HG_STORE_GRPC_HOST: store1
HG_STORE_GRPC_PORT: "8500"
HG_STORE_REST_PORT: "8520"
HG_STORE_RAFT_ADDRESS: store1:8510
HG_STORE_DATA_PATH: /hugegraph-store/storage
ports: ["8501:8500", "8511:8510", "8521:8520"]
volumes:
- hg-store1-data:/hugegraph-store/storage
store2:
<<: *store-common
container_name: hg-store2
hostname: store2
environment:
HG_STORE_PD_ADDRESS: pd0:8686,pd1:8686,pd2:8686
HG_STORE_GRPC_HOST: store2
HG_STORE_GRPC_PORT: "8500"
HG_STORE_REST_PORT: "8520"
HG_STORE_RAFT_ADDRESS: store2:8510
HG_STORE_DATA_PATH: /hugegraph-store/storage
ports: ["8502:8500", "8512:8510", "8522:8520"]
volumes:
- hg-store2-data:/hugegraph-store/storage
# --- Server cluster (3 nodes) ---
server0:
<<: *server-common
container_name: hg-server0
hostname: server0
ports: ["8080:8080"]
server1:
<<: *server-common
container_name: hg-server1
hostname: server1
ports: ["8081:8080"]
server2:
<<: *server-common
container_name: hg-server2
hostname: server2
ports: ["8082:8080"]