-
Notifications
You must be signed in to change notification settings - Fork 8
/
elasticsearch.yaml
188 lines (169 loc) · 4.78 KB
/
elasticsearch.yaml
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
# ############################################################################ #
# Overwrite file for logging to Elasticsearch
#
# Usage:
#
# docker compose -f docker-compose.yaml -f elasticsearch.yaml up -d
#
configs:
chainweb-node.logging:
file: ./config/chainweb-node.elastic.yaml
metricbeat:
file: ./config/metricbeat.yaml
filebeat:
file: ./config/filebeat.yaml
services:
# ########################################################################## #
# Configure Nodes Logging for Elasticsearch
bootstrap-node:
depends_on:
elasticsearch:
condition: service_healthy
common-node:
depends_on:
elasticsearch:
condition: service_healthy
mining-node:
depends_on:
elasticsearch:
condition: service_healthy
mining-api-node:
depends_on:
elasticsearch:
condition: service_healthy
api-node:
depends_on:
elasticsearch:
condition: service_healthy
api-proxy:
labels:
co.elastic.metrics/module: nginx
co.elastic.metrics/metricsets: stubstatus
co.elastic.metrics/hosts: '$${data.host}:80'
co.elastic.metrics/period: 10s
# ########################################################################## #
# Elastic Search
elasticsearch:
container_name: elasticsearch
image: docker.elastic.co/elasticsearch/elasticsearch:8.4.2
environment:
- xpack.security.enabled=false
- xpack.security.http.ssl.enabled=false
- xpack.security.transport.ssl.enabled=false
- discovery.type=single-node
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
mem_limit: 2147483648
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
cap_add:
- IPC_LOCK
healthcheck:
test: "curl --fail -s http://elasticsearch:9200"
interval: 5s
timeout: 5s
retries: 120
# ########################################################################## #
# Kibana
kibana:
container_name: kibana
depends_on:
elasticsearch:
condition: service_healthy
image: docker.elastic.co/kibana/kibana:8.4.2
ports:
- 5601:5601
environment:
ELASTICSEARCH_URL: http://elasticsearch:9200
ELASTICSEARCH_HOSTS: http://elasticsearch:9200
KIBANA_FLEET_SETUP: false
healthcheck:
test: "curl --fail -s http://kibana:5601/api/status"
interval: 5s
timeout: 5s
retries: 120
# Upload saved objects
kibana-objects:
container_name: kibana-objects
depends_on:
kibana:
condition: service_healthy
image: curlimages/curl:latest
volumes:
- ./config/kibana:/chainweb/config/kibana:ro
entrypoint: ["/bin/sh"]
command:
- -c
- |
for FILE in chainweb/config/kibana/*.ndjson ; do
echo "uploading $$FILE"
RESULT=1
COUNT=0
while [ ! $$RESULT -eq 0 -a $$COUNT -lt 6 ] ; do
sleep 3
echo "attempt to upload kibana saved objects $$FILE"
curl --fail -s 'http://kibana:5601/api/saved_objects/_import?overwrite=true' \
-X POST \
-H 'kbn-xsrf: true' \
--form "file=@$$FILE"
RESULT=$$?
COUNT=$$((COUNT + 1))
echo
echo "result: $$RESULT"
done
done
echo "done"
# ########################################################################## #
# Metricbeat
metricbeat:
container_name: metricbeat
depends_on:
elasticsearch:
condition: service_healthy
kibana:
condition: service_healthy
image: docker.elastic.co/beats/metricbeat:8.4.2
command:
- -e
- --strict.perms=false
- -e
- -system.hostfs=/hostfs
environment:
setup.kibana.host: kibana:5601
output.elasticsearch.hosts: '["elasticsearch:9200"]'
user: root
cap_add:
- sys_ptrace
- dac_read_search
volumes:
- ./config/metricbeat.yaml:/usr/share/metricbeat/metricbeat.yml:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- /proc:/hostfs/proc:ro
- /sys/fs/cgroup:/hostfs/sys/fs/cgroup:ro
- /:/hostfs:ro
# ########################################################################## #
# Filebeat
filebeat:
container_name: filebeat
depends_on:
elasticsearch:
condition: service_healthy
kibana:
condition: service_healthy
image: docker.elastic.co/beats/filebeat:8.4.2
command:
- -e
- --strict.perms=false
environment:
setup.kibana.host: kibana:5601
output.elasticsearch.hosts: '["elasticsearch:9200"]'
user: root
volumes:
- ./config/filebeat.yaml:/usr/share/filebeat/filebeat.yml:ro
- /var/lib/docker/containers:/var/lib/docker/containers:ro
- /var/run/docker.sock:/var/run/docker.sock:ro