-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
217 lines (204 loc) · 4.94 KB
/
docker-compose.yml
File metadata and controls
217 lines (204 loc) · 4.94 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
version: "2.4"
# docker compose versions see: https://github.com/docker/compose/issues/4513#issuecomment-368167466
#
# the underlying host/vm needs this config setting or ES nodes will not boot fully
# with a bootstrap failure
#
# myhostmachine$ sudo sysctl -w vm.max_map_count=262144
#
# test all ok with curl http://localhost:9200/_cluster/health?pretty
# cpu count
# $ grep processor /proc/cpuinfo | wc -l
# 8
services:
es01:
image: docker.elastic.co/elasticsearch/elasticsearch:7.13.0
container_name: es01
restart: always
environment:
node.name: es01
discovery.seed_hosts: es02,es03
#load in common ES settings/config
env_file:
- es-common-vars.env
ulimits:
memlock:
soft: -1
hard: -1
# hardware throttling
cpus: 4.0
mem_limit: 12g
memswap_limit: 12g
volumes:
- ./data01:/usr/share/elasticsearch/data
ports:
- 9200:9200
networks:
- elastic
# check health here: docker inspect --format='{{json .State.Health}}' es01
healthcheck:
test:
[
"CMD-SHELL",
"curl --silent --fail localhost:9200/_cluster/health || exit 1",
]
interval: 30s
timeout: 30s
retries: 3
start_period: 1m
es02:
image: docker.elastic.co/elasticsearch/elasticsearch:7.13.0
container_name: es02
restart: always
environment:
- node.name=es02
- discovery.seed_hosts=es01,es03
#load in common ES settings/config
env_file:
- es-common-vars.env
ulimits:
memlock:
soft: -1
hard: -1
# hardware throttling
cpus: 4
mem_limit: 12g
memswap_limit: 12g
volumes:
- ./data02:/usr/share/elasticsearch/data
ports:
- 9202:9200
networks:
- elastic
healthcheck:
test:
[
"CMD-SHELL",
"curl --silent --fail localhost:9200/_cluster/health || exit 1",
]
interval: 30s
timeout: 30s
retries: 3
start_period: 1m
es03:
image: docker.elastic.co/elasticsearch/elasticsearch:7.13.0
container_name: es03
restart: always
environment:
- node.name=es03
- discovery.seed_hosts=es01,es02
#load in common ES settings/config
env_file:
- es-common-vars.env
ulimits:
memlock:
soft: -1
hard: -1
# hardware throttling
cpus: 4
mem_limit: 12g
memswap_limit: 12g
volumes:
- ./data03:/usr/share/elasticsearch/data
ports:
- 9203:9200
networks:
- elastic
healthcheck:
test:
[
"CMD-SHELL",
"curl --silent --fail localhost:9200/_cluster/health || exit 1",
]
interval: 30s
timeout: 30s
retries: 3
start_period: 1m
#
# takes around 3mins to come up live
#
kb01:
image: docker.elastic.co/kibana/kibana:7.13.0
container_name: kb01
restart: always
ports:
- 5601:5601
# hardware throttling
cpus: 4
mem_limit: 6g
# monitoring.ui.container.logstash.enabled: "true"
networks:
- elastic
volumes:
- ./kb01:/data
# IMPORTANT! use own copy of the config
- ./kibana.yml:/usr/share/kibana/config/kibana.yml
#environment:
# - ELASTICSEARCH_USERNAME=elastic
# - ELASTICSEARCH_PASSWORD=Password01
healthcheck:
test:
[
"CMD-SHELL",
"curl --silent --fail http://localhost:5601/api/status || exit 1",
]
interval: 30s
timeout: 30s
retries: 3
start_period: 3m
ls01:
image: docker.elastic.co/logstash/logstash:7.13.0
container_name: ls01
restart: always
ports:
- 5045:5045
- 5445:5445
- 9601:9600
environment:
ELASTICSEARCH_URL: http://es01:9200
ELASTICSEARCH_HOSTS: http://es01:9200
LS_JAVA_OPTS: -Xms4096m -Xmx4096m
# hardware throttling
cpus: 4
mem_limit: 6g
networks:
- elastic
volumes:
- ./ls01/data/:/usr/share/logstash/data/
- ./ls01/config/:/usr/share/logstash/config/
healthcheck:
test:
[
"CMD-SHELL",
"curl --silent --fail http://localhost:9600/_node/pipelines || exit 1",
]
interval: 30s
timeout: 30s
retries: 3
#start_period: 1m
# fs01:
# image: docker.elastic.co/beats/elastic-agent:7.13.0
# depends_on:
# es01:
# condition: service_healthy
# kb01:
# condition: service_healthy
# healthcheck:
# test: "curl -f http://127.0.0.1:8220/api/status | grep HEALTHY 2>&1 >/dev/null"
# retries: 12
# interval: 5s
# hostname: docker-fleet-server
# environment:
# - "FLEET_SERVER_ENABLE=1"
# - "FLEET_SERVER_INSECURE_HTTP=1"
# - "KIBANA_FLEET_SETUP=1"
# - "KIBANA_FLEET_HOST=http://kb01:5601"
# - "FLEET_SERVER_HOST=0.0.0.0"
# - "STATE_PATH=/usr/share/elastic-agent"
# ports:
# - "8220:8220"
# networks:
# - elastic
networks:
elastic:
driver: bridge