This repository has been archived by the owner on May 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 339
/
thanos-compose.yml
309 lines (292 loc) · 7.83 KB
/
thanos-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
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
version: '3'
services:
mc:
image: minio/mc
container_name: mc
entrypoint: |
sh -c 'sh -s << EOF
mc config host add tmp uvo1f7e7qbkxtmmt5iq.vm.cld.sr AKIAtEpiGWUcQIelPRlD1Pi6xQ YNV6xS8lXnCTGSy1x2vGkmGnmdJbZSapNXaSaRhK
mc mb tmp/thanos
mc config host rm tmp
sleep 10000000
EOF'
networks:
- thanos
prometheus0:
image: prom/prometheus:v2.9.2
container_name: prometheus0
user: root
volumes:
- thanos0:/data
- ./data/prom0/prometheus.yml:/etc/prometheus/prometheus.yml
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/data/prom0"
- "--log.level=warn"
- "--web.enable-lifecycle"
- "--storage.tsdb.min-block-duration=2h"
- "--storage.tsdb.max-block-duration=2h"
- "--web.listen-address=0.0.0.0:9090"
networks:
- thanos
prometheus1:
image: prom/prometheus:v2.9.2
container_name: prometheus1
user: root
volumes:
- thanos1:/data
- ./data/prom1/prometheus.yml:/etc/prometheus/prometheus.yml
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/data/prom1"
- "--log.level=warn"
- "--web.enable-lifecycle"
- "--storage.tsdb.min-block-duration=2h"
- "--storage.tsdb.max-block-duration=2h"
- "--web.listen-address=0.0.0.0:9091"
networks:
- thanos
prometheus2:
image: prom/prometheus:v2.9.2
container_name: prometheus2
user: root
volumes:
- thanos2:/data
- ./data/prom2/prometheus.yml:/etc/prometheus/prometheus.yml
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/data/prom2"
- "--log.level=warn"
- "--web.enable-lifecycle"
- "--storage.tsdb.min-block-duration=2h"
- "--storage.tsdb.max-block-duration=2h"
- "--web.listen-address=0.0.0.0:9092"
networks:
- thanos
sidecar0:
image: thanosio/thanos:v0.10.0
container_name: thanos-sidecar0
command:
- "sidecar"
- "--debug.name=sidecar-0"
- "--log.level=debug"
- "--grpc-address=0.0.0.0:10901"
- "--grpc-grace-period=1s"
- "--http-address=0.0.0.0:10902"
- "--http-grace-period=1s"
- "--prometheus.url=http://prometheus0:9090"
- "--tsdb.path=/data/prom0"
- "--objstore.config-file=/bucket.yml"
volumes:
- thanos0:/data
- ./data/bucket.yml:/bucket.yml
depends_on:
- prometheus0
networks:
- thanos
sidecar1:
image: thanosio/thanos:v0.10.0
container_name: thanos-sidecar1
command:
- "sidecar"
- "--debug.name=sidecar-1"
- "--log.level=debug"
- "--grpc-address=0.0.0.0:10911"
- "--grpc-grace-period=1s"
- "--http-address=0.0.0.0:10912"
- "--http-grace-period=1s"
- "--prometheus.url=http://prometheus1:9091"
- "--tsdb.path=/data/prom1"
- "--objstore.config-file=/bucket.yml"
volumes:
- thanos1:/data
- ./data/bucket.yml:/bucket.yml
depends_on:
- prometheus1
networks:
- thanos
sidecar2:
image: thanosio/thanos:v0.10.0
container_name: thanos-sidecar2
command:
- "sidecar"
- "--debug.name=sidecar-2"
- "--log.level=debug"
- "--grpc-address=0.0.0.0:10921"
- "--grpc-grace-period=1s"
- "--http-address=0.0.0.0:10922"
- "--http-grace-period=1s"
- "--prometheus.url=http://prometheus2:9092"
- "--tsdb.path=/data/prom2"
- "--objstore.config-file=/bucket.yml"
volumes:
- thanos2:/data
- ./data/bucket.yml:/bucket.yml
depends_on:
- prometheus2
networks:
- thanos
store:
image: thanosio/thanos:v0.10.0
container_name: thanos-store
restart: always
command:
- "store"
- "--debug.name=store"
- "--log.level=debug"
- "--grpc-address=0.0.0.0:10905"
- "--grpc-grace-period=1s"
- "--http-address=0.0.0.0:10906"
- "--http-grace-period=1s"
- "--data-dir=/data/store"
- "--objstore.config-file=/bucket.yml"
volumes:
- store:/data
- ./data/bucket.yml:/bucket.yml
networks:
- thanos
receive:
image: thanosio/thanos:v0.10.0
container_name: thanos-receive
command:
- "receive"
- "--debug.name=receive"
- "--log.level=debug"
- "--tsdb.path=/data/remote-write-receive-data"
- "--grpc-address=0.0.0.0:10907"
- "--grpc-grace-period=1s"
- "--http-address=0.0.0.0:10909"
- "--http-grace-period=1s"
- "--label=receive=\"true\""
- "--objstore.config-file=/bucket.yml"
- "--remote-write.address=0.0.0.0:10908"
volumes:
- receive:/data
- ./data/bucket.yml:/bucket.yml
networks:
- thanos
remotewrite:
image: prom/prometheus:v2.9.2
container_name: thanos-remote-write
user: root
volumes:
- ./data/local-prometheus-data/prometheus.yml:/etc/prometheus/prometheus.yml
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
depends_on:
- prometheus0
- sidecar0
networks:
- thanos
node-exporter:
image: prom/node-exporter:v0.18.1
container_name: node-exporter
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- '--path.procfs=/host/proc'
- '--path.rootfs=/rootfs'
- '--path.sysfs=/host/sys'
- '--collector.filesystem.ignored-mount-points=^/(sys|proc|dev|host|etc)($$|/)'
networks:
- thanos
query0:
image: thanosio/thanos:v0.10.0
container_name: thanos-query0
command:
- "query"
- "--debug.name=query0"
- "--log.level=debug"
- "--grpc-address=0.0.0.0:10903"
- "--grpc-grace-period=1s"
- "--http-address=0.0.0.0:10904"
- "--http-grace-period=1s"
- "--query.replica-label=prometheus"
- "--store=sidecar0:10901"
- "--store=sidecar1:10911"
- "--store=sidecar2:10921"
- "--store=store:10905"
- "--store=receive:10907"
ports:
- 10904:10904
depends_on:
- sidecar0
- sidecar1
- sidecar2
- store
- receive
networks:
- thanos
query1:
image: thanosio/thanos:v0.10.0
container_name: thanos-query1
command:
- "query"
- "--debug.name=query1"
- "--log.level=debug"
- "--grpc-address=0.0.0.0:10913"
- "--grpc-grace-period=1s"
- "--http-address=0.0.0.0:10914"
- "--http-grace-period=1s"
- "--query.replica-label=prometheus"
- "--store=sidecar0:10901"
- "--store=sidecar1:10911"
- "--store=sidecar2:10921"
- "--store=store:10905"
- "--store=receive:10907"
depends_on:
- sidecar0
- sidecar1
- sidecar2
- store
- receive
networks:
- thanos
compactor:
image: thanosio/thanos:v0.10.0
container_name: compactor
command:
- "compact"
- "--data-dir=/tmp/thanos-compact"
- "--log.level=debug"
- "--objstore.config-file=/bucket.yml"
- "--http-address=0.0.0.0:10902"
- "--http-grace-period=2m"
- "--consistency-delay=30m"
volumes:
- compact:/tmp
- ./data/bucket.yml:/bucket.yml
depends_on:
- sidecar0
- sidecar1
- sidecar2
- store
networks:
- thanos
grafana:
image: grafana/grafana:6.5.2
container_name: grafana
#volumes:
# - grafana_data:/var/lib/grafana
# - ./grafana/provisioning:/etc/grafana/provisioning
environment:
- GF_SECURITY_ADMIN_USER=${ADMIN_USER:-admin}
- GF_SECURITY_ADMIN_PASSWORD=${ADMIN_PASSWORD:-admin}
- GF_USERS_ALLOW_SIGN_UP=false
restart: unless-stopped
ports:
- 3000:3000
networks:
- thanos
networks:
thanos: {}
volumes:
thanos0: {}
thanos1: {}
thanos2: {}
store: {}
receive: {}
compact: {}