-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-64G.yml
390 lines (370 loc) · 9.88 KB
/
docker-compose-64G.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
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
services:
etl:
image: disk91/etl
container_name: etl
restart: unless-stopped
stop_grace_period: 180m
depends_on:
mongo-router01:
condition: service_healthy
mongo-router02:
condition: service_healthy
environment:
- AWS_ACCESS_KEY=
- AWS_SECRET_KEY=
- SOLANA_APIKEY=
mem_limit: 33000m
memswap_limit: 33000m
mem_reservation: 33000m
ports:
- 127.0.0.1:8091:8091
profiles:
- etl
networks:
- public_net
- mongo_net
- monitoring_net
logging: &logs
driver: "json-file"
options:
max-size: "100m"
## Nginx front
nginx:
image: nginx:latest
ports:
- 80:80
- 443:443
restart: unless-stopped
depends_on:
- etl
volumes:
- /etl/configuration/nginx/:/etc/nginx/conf.d/:ro
- /etl/configuration/certbot/:/var/www/certbot/:ro
- /etl/configuration/ssl/:/etc/nginx/ssl/:ro
- /etl/configuration/nginx/.htpasswd:/etc/nginx/.htpasswd
profiles:
- webserver
networks:
- public_net
certbot:
image: certbot/certbot:latest
volumes:
- /etl/configuration/certbot/:/var/www/certbot/:rw
- /etl/configuration/ssl/:/etc/letsencrypt/:rw
## Router - get the traffic request
mongo-router01:
image: mongo:6.0.13
container_name: mongo-router-01
command: mongos --port 27017 --configdb rs-config-server/mongo-configsvr01:27017,mongo-configsvr02:27017,mongo-configsvr03:27017 --bind_ip_all
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
interval: 10s
timeout: 5s
retries: 3
start_period: 30s
ports:
- 127.0.0.1:27120:27017
restart: always
volumes:
- /etl/configuration/mongo/scripts:/scripts
- /etl/mongo/router-01:/data/db
- /etl/configuration/mongo/router-01:/data/configdb
profiles:
- mongo
depends_on:
- mongo-configsvr01
- mongo-configsvr02
- mongo-configsvr03
- mongo-shard01a
- mongo-shard02a
- mongo-shard03a
networks:
- mongo_net
logging: *logs
mongo-router02:
image: mongo:6.0.13
container_name: mongo-router-02
command: mongos --port 27017 --configdb rs-config-server/mongo-configsvr01:27017,mongo-configsvr02:27017,mongo-configsvr03:27017 --bind_ip_all
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
interval: 10s
timeout: 5s
retries: 3
start_period: 30s
ports:
- 127.0.0.1:27121:27017
restart: always
volumes:
- /etl/configuration/mongo/scripts:/scripts
- /etl/mongo/router-02:/data/db
- /etl/configuration/mongo/router-02:/data/configdb
networks:
- mongo_net
profiles:
- mongo
depends_on:
- mongo-configsvr01
- mongo-configsvr02
- mongo-configsvr03
- mongo-shard01a
- mongo-shard02a
- mongo-shard03a
logging: *logs
## Config Servers - know the cluster configuration
mongo-configsvr01:
image: mongo:6.0.13
container_name: mongo-config-01
command: mongod --port 27017 --configsvr --replSet rs-config-server
volumes:
- /etl/configuration/mongo/scripts:/scripts
- /etl/mongo/config-01:/data/db
- /etl/configuration/mongo/config-01:/data/configdb
restart: always
networks:
- mongo_net
profiles:
- mongo
logging: *logs
mongo-configsvr02:
image: mongo:6.0.13
container_name: mongo-config-02
command: mongod --port 27017 --configsvr --replSet rs-config-server
volumes:
- /etl/configuration/mongo/scripts:/scripts
- /etl/mongo/config-02:/data/db
- /etl/configuration/mongo/config-02:/data/configdb
restart: always
networks:
- mongo_net
profiles:
- mongo
logging: *logs
mongo-configsvr03:
image: mongo:6.0.13
container_name: mongo-config-03
command: mongod --port 27017 --configsvr --replSet rs-config-server
volumes:
- /etl/configuration/mongo/scripts:/scripts
- /etl/mongo/config-03:/data/db
- /etl/configuration/mongo/config-03:/data/configdb
restart: always
networks:
- mongo_net
profiles:
- mongo
logging: *logs
## Shards
mongo-shard01a:
image: mongo:6.0.13
container_name: shard-01-node-a
command: mongod --port 27017 --shardsvr --replSet rs-shard-01
deploy:
resources:
limits:
memory: 3200m
volumes:
- /etl/configuration/mongo/scripts:/scripts
- /etl/mongo/shard-01a:/data/db
- /etl/configuration/mongo/shard-01a:/data/configdb
restart: always
profiles:
- mongo
networks:
- mongo_net
logging: *logs
mongo-shard02a:
image: mongo:6.0.13
container_name: shard-02-node-a
command: mongod --port 27017 --shardsvr --replSet rs-shard-02
deploy:
resources:
limits:
memory: 3200m
volumes:
- /etl/configuration/mongo/scripts:/scripts
- /etl/mongo/shard-02a:/data/db
- /etl/configuration/mongo/shard-02a:/data/configdb
restart: always
profiles:
- mongo
networks:
- mongo_net
logging: *logs
mongo-shard03a:
image: mongo:6.0.13
container_name: shard-03-node-a
command: mongod --port 27017 --shardsvr --replSet rs-shard-03
deploy:
resources:
limits:
memory: 3200m
volumes:
- /etl/configuration/mongo/scripts:/scripts
- /etl/mongo/shard-03a:/data/db
- /etl/configuration/mongo/shard-03a:/data/configdb
restart: always
profiles:
- mongo
networks:
- mongo_net
logging: *logs
prometheus:
image: prom/prometheus
container_name: etl-prometheus
restart: unless-stopped
volumes:
- /etl/configuration/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- /etl/prometheus:/prometheus
profiles:
- monitoring
networks:
- monitoring_net
- public_net
ports:
- 127.0.0.1:9090:9090
extra_hosts:
- "host.docker.internal:host-gateway"
logging: *logs
node_exporter:
image: prom/node-exporter:latest
container_name: etl-node-exp
command:
- '--web.listen-address=127.0.0.1:9100'
- '--web.listen-address=host.docker.internal:9100'
- '--path.procfs=/host/proc'
- '--path.rootfs=/rootfs'
- '--path.sysfs=/host/sys'
- "--collector.filesystem"
- "--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)"
- "--collector.netstat"
- "--collector.meminfo"
- "--collector.cpu"
- "--collector.loadavg"
- "--collector.systemd"
- "--collector.processes"
- "--collector.ethtool"
- "--collector.interrupts"
- "--collector.tcpstat"
pid: host
network_mode: host
extra_hosts:
- "host.docker.internal:host-gateway"
security_opt:
- apparmor:unconfined
restart: unless-stopped
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
- /run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket:ro
profiles:
- monitoring
logging: *logs
mongo_exporter:
image: percona/mongodb_exporter:2.36
container_name: etl-mongo-exporter
restart: unless-stopped
command:
- "--web.listen-address=0.0.0.0:9216"
- "--discovering-mode"
- "--collector.diagnosticdata"
- "--collector.replicasetstatus"
- "--collector.dbstats"
- "--collector.topmetrics"
- "--collector.indexstats"
- "--collector.collstats"
- "--compatible-mode"
ports:
- 127.0.0.1:9216:9216
environment:
- MONGODB_URI=mongodb://mongo-shard01a:27017
profiles:
- monitoring
networks:
- monitoring_net
- mongo_net
logging: *logs
cadvisor:
image: gcr.io/cadvisor/cadvisor:latest
container_name: etl-cadvisor
privileged: true
devices:
- /dev/kmsg:/dev/kmsg
volumes:
- /:/rootfs:ro
- /var/run:/var/run:ro
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
- /cgroup:/cgroup:ro
command:
- '-port=8093'
restart: unless-stopped
profiles:
- monitoring
networks:
- monitoring_net
ports:
- 127.0.0.1:8093:8093
logging: *logs
grafana:
image: grafana/grafana-oss
container_name: etl-grafana
restart: unless-stopped
volumes:
- /etl/grafana:/var/lib/grafana
- /etl/configuration/grafana:/etc/grafana/provisioning
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_USERS_ALLOW_SIGN_UP=false
- GF_SERVER_HTTP_PORT=8092
depends_on:
- prometheus
profiles:
- monitoring
networks:
- monitoring_net
- public_net
ports:
- 127.0.0.1:8092:8092
logging: *logs
networks:
public_net:
ipam:
driver: default
config:
- subnet: 172.99.1.0/24
gateway: 172.99.1.254
aux_addresses:
etl: 172.99.1.99
prometheus: 172.99.1.97
grafana: 172.99.1.95
nginx: 172.99.1.94
mongo_net:
ipam:
driver: default
config:
- subnet: 172.99.2.0/24
gateway: 172.99.2.254
aux_addresses:
etl: 172.99.2.99
mongo_exporter: 172.99.2.98
mongo-router01: 172.99.2.1
mongo-router02: 172.99.2.2
mongo-configsvr01: 172.99.2.61
mongo-configsvr02: 172.99.2.62
mongo-configsvr03: 172.99.2.63
mongo-shard01a: 172.99.2.10
mongo-shard02a: 172.99.2.20
mongo-shard03a: 172.99.2.30
monitoring_net:
ipam:
driver: default
config:
- subnet: 172.99.3.0/24
gateway: 172.99.3.254
aux_addresses:
etl: 172.99.3.99
prometheus: 172.99.3.97
mongo_exporter: 172.99.3.96
grafana: 172.99.3.95