-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocess-compose.yml
More file actions
310 lines (292 loc) · 9.59 KB
/
Copy pathprocess-compose.yml
File metadata and controls
310 lines (292 loc) · 9.59 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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
version: "0.5"
is_tui_disabled: true
vars:
GREPTIME_BIN: ./greptime
GREPTIME_HOME: ./.greptimedb
METASRV_ADDR: "127.0.0.1:11020"
processes:
garage:
command: |
garage -c garage.toml server
readiness_probe:
exec:
command: "garage -c garage.toml status"
initial_delay_seconds: 2
period_seconds: 3
timeout_seconds: 5
availability:
restart: on_failure
max_restarts: 5
disabled: true
garage-setup:
command: |
GREPTIME_HOME={{.GREPTIME_HOME}} scripts/garage-setup
depends_on:
garage:
condition: process_healthy
availability:
restart: on_failure
max_restarts: 5
disabled: true
metasrv:
command: |
GREPTIME_BIN={{.GREPTIME_BIN}} GREPTIME_HOME={{.GREPTIME_HOME}} scripts/start-metasrv 0 0.0.0.0:11020 127.0.0.1:11020 0.0.0.0:11021
depends_on:
postgres:
condition: process_healthy
readiness_probe:
exec:
command: "curl -sf http://127.0.0.1:11021/health"
initial_delay_seconds: 2
period_seconds: 3
timeout_seconds: 3
availability:
restart: on_failure
max_restarts: 5
disabled: true
metasrv-1:
command: |
GREPTIME_BIN={{.GREPTIME_BIN}} GREPTIME_HOME={{.GREPTIME_HOME}} scripts/start-metasrv 1 0.0.0.0:11022 127.0.0.1:11022 0.0.0.0:11023
depends_on:
postgres:
condition: process_healthy
readiness_probe:
exec:
command: "curl -sf http://127.0.0.1:11023/health"
initial_delay_seconds: 2
period_seconds: 3
timeout_seconds: 3
availability:
restart: on_failure
max_restarts: 5
disabled: true
datanode-0:
command: |
GREPTIME_BIN={{.GREPTIME_BIN}} GREPTIME_HOME={{.GREPTIME_HOME}} METASRV_ADDR={{.METASRV_ADDR}} scripts/start-datanode 0 0.0.0.0:11030 0.0.0.0:11031
depends_on:
metasrv:
condition: process_healthy
garage-setup:
condition: process_completed_successfully
readiness_probe:
exec:
command: "curl -sf http://127.0.0.1:11031/health"
initial_delay_seconds: 2
period_seconds: 3
timeout_seconds: 3
availability:
restart: on_failure
max_restarts: 5
disabled: true
datanode-1:
command: |
GREPTIME_BIN={{.GREPTIME_BIN}} GREPTIME_HOME={{.GREPTIME_HOME}} METASRV_ADDR={{.METASRV_ADDR}} scripts/start-datanode 1 0.0.0.0:11032 0.0.0.0:11033
depends_on:
metasrv:
condition: process_healthy
garage-setup:
condition: process_completed_successfully
readiness_probe:
exec:
command: "curl -sf http://127.0.0.1:11033/health"
initial_delay_seconds: 2
period_seconds: 3
timeout_seconds: 3
availability:
restart: on_failure
max_restarts: 5
disabled: true
frontend:
command: |
GREPTIME_BIN={{.GREPTIME_BIN}} GREPTIME_HOME={{.GREPTIME_HOME}} METASRV_ADDR={{.METASRV_ADDR}} scripts/start-frontend 0 0.0.0.0:11050 0.0.0.0:11051 127.0.0.1:11051 0.0.0.0:11052 0.0.0.0:11053
depends_on:
metasrv:
condition: process_healthy
datanode-0:
condition: process_healthy
datanode-1:
condition: process_healthy
readiness_probe:
exec:
command: "curl -sf http://127.0.0.1:11050/health"
initial_delay_seconds: 2
period_seconds: 3
timeout_seconds: 3
availability:
restart: on_failure
max_restarts: 5
disabled: true
frontend-1:
command: |
GREPTIME_BIN={{.GREPTIME_BIN}} GREPTIME_HOME={{.GREPTIME_HOME}} METASRV_ADDR={{.METASRV_ADDR}} scripts/start-frontend 1 0.0.0.0:11054 0.0.0.0:11055 127.0.0.1:11055 0.0.0.0:11056 0.0.0.0:11057
depends_on:
metasrv:
condition: process_healthy
datanode-0:
condition: process_healthy
datanode-1:
condition: process_healthy
readiness_probe:
exec:
command: "curl -sf http://127.0.0.1:11054/health"
initial_delay_seconds: 2
period_seconds: 3
timeout_seconds: 3
availability:
restart: on_failure
max_restarts: 5
disabled: true
haproxy:
command: |
haproxy -f haproxy.cfg
depends_on:
frontend:
condition: process_healthy
readiness_probe:
exec:
command: "curl -sf http://127.0.0.1:11040/health"
initial_delay_seconds: 2
period_seconds: 3
timeout_seconds: 3
availability:
restart: on_failure
max_restarts: 5
disabled: true
flownode:
command: |
GREPTIME_BIN={{.GREPTIME_BIN}} GREPTIME_HOME={{.GREPTIME_HOME}} METASRV_ADDR={{.METASRV_ADDR}} scripts/start-flownode 0 0.0.0.0:11060 127.0.0.1:11060 0.0.0.0:11061
depends_on:
metasrv:
condition: process_healthy
readiness_probe:
exec:
command: "curl -sf http://127.0.0.1:11061/health"
initial_delay_seconds: 2
period_seconds: 3
timeout_seconds: 3
availability:
restart: on_failure
max_restarts: 5
disabled: true
standalone:
command: |
GREPTIME_HOME={{.GREPTIME_HOME}} GREPTIME_BIN={{.GREPTIME_BIN}} scripts/start-standalone
depends_on:
garage-setup:
condition: process_completed_successfully
readiness_probe:
exec:
command: "curl -sf http://127.0.0.1:11040/health"
initial_delay_seconds: 2
period_seconds: 3
timeout_seconds: 3
availability:
restart: on_failure
max_restarts: 5
disabled: true
standalone-fs:
command: |
GREPTIME_HOME={{.GREPTIME_HOME}} GREPTIME_BIN={{.GREPTIME_BIN}} scripts/start-standalone-fs
readiness_probe:
exec:
command: "curl -sf http://127.0.0.1:11040/health"
initial_delay_seconds: 2
period_seconds: 3
timeout_seconds: 3
availability:
restart: on_failure
max_restarts: 5
disabled: true
# ─────────────────────────────────────────────────────────────────────
# Enterprise active/standby standalone mode
#
# Two enterprise standalone instances share Garage S3 (main data store) and a
# Postgres metadata table (shared metadata + leader election). Each has its
# own local WAL. Only the elected leader accepts writes; the follower rejects
# writes (HTTP 503). haproxy-standby routes client traffic to the active
# leader via /status/standalone/is_leader.
#
# Requires an ENTERPRISE greptime binary in the project root (./greptime) or
# GREPTIME_BIN pointing at one — the OSS ./greptime cannot run this mode.
# Start the whole chain with: process-compose up haproxy-standby
# Chain: garage -> garage-setup -> postgres -> standby-a -> standby-b -> haproxy-standby
# ─────────────────────────────────────────────────────────────────────
# Postgres metadata + election backend. Idempotently inits the data dir, then
# runs the server in the foreground. Trust auth, localhost only.
postgres:
command: |
GREPTIME_HOME={{.GREPTIME_HOME}} scripts/start-postgres 11080
readiness_probe:
exec:
command: "pg_isready -h 127.0.0.1 -p 11080 -U postgres -d postgres"
initial_delay_seconds: 2
period_seconds: 3
timeout_seconds: 3
availability:
restart: on_failure
max_restarts: 5
disabled: true
# Active leader candidate. Binds internal ports 11070-11073.
standby-a:
command: |
GREPTIME_HOME={{.GREPTIME_HOME}} GREPTIME_BIN={{.GREPTIME_BIN}} scripts/start-standalone-standby a 0.0.0.0:11070 0.0.0.0:11071 0.0.0.0:11072 0.0.0.0:11073
depends_on:
garage-setup:
condition: process_completed_successfully
postgres:
condition: process_healthy
readiness_probe:
exec:
command: "curl -sf http://127.0.0.1:11070/health"
initial_delay_seconds: 15
period_seconds: 3
timeout_seconds: 5
availability:
restart: on_failure
max_restarts: 5
disabled: true
# Standby follower. Binds internal ports 11074-11077. Started after standby-a
# is healthy to avoid concurrent metadata-table creation races; both then
# converge via election (one leader, one follower).
standby-b:
command: |
GREPTIME_HOME={{.GREPTIME_HOME}} GREPTIME_BIN={{.GREPTIME_BIN}} scripts/start-standalone-standby b 0.0.0.0:11074 0.0.0.0:11075 0.0.0.0:11076 0.0.0.0:11077
depends_on:
garage-setup:
condition: process_completed_successfully
postgres:
condition: process_healthy
standby-a:
condition: process_healthy
readiness_probe:
exec:
command: "curl -sf http://127.0.0.1:11074/health"
initial_delay_seconds: 15
period_seconds: 3
timeout_seconds: 5
availability:
restart: on_failure
max_restarts: 5
disabled: true
# Client-facing entry point (11040-11043). Routes ONLY to the elected leader
# via /status/standalone/is_leader health checks. Readiness rides through the
# startup election window (no leader yet => 503 => not ready; passes once a
# leader is elected, typically a few seconds after both standalones are up).
haproxy-standby:
command: |
haproxy -f haproxy-standby.cfg
depends_on:
standby-a:
condition: process_healthy
standby-b:
condition: process_healthy
readiness_probe:
exec:
command: "curl -sf http://127.0.0.1:11040/health"
initial_delay_seconds: 5
period_seconds: 3
timeout_seconds: 5
availability:
restart: on_failure
max_restarts: 5
disabled: true