-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.multi-node.yaml
More file actions
92 lines (81 loc) · 3.16 KB
/
Copy pathcompose.multi-node.yaml
File metadata and controls
92 lines (81 loc) · 3.16 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
# Compose override file for multi-node Elasticsearch cluster.
# This file must be used together with `compose.yaml` file when using a multi-node Elasticsearch mode.
# When starting a multi-node cluster for the first time, use the `compose.multi-node.bootstrap.yaml` as well.
x-es-common: &es-common
image: docker.elastic.co/elasticsearch/elasticsearch:${STACK_VERSION}
restart: unless-stopped
networks:
- internal
mem_limit: ${ES_MEM_LIMIT}
# NOTE: Comment out if using Docker in rootless mode (container cannot have unlimited locked-in-memory address space)
ulimits:
memlock:
soft: -1
hard: -1
healthcheck:
test: ["CMD-SHELL", "curl -s --cacert config/certs/ca/ca.crt https://localhost:9200 | grep -q 'missing authentication credentials'"]
interval: 10s
timeout: 30s
retries: 120
# NOTE: Not needed if setup-certs service runs separately to generate certificates or if external certificates are used
#depends_on:
# setup-certs:
# condition: service_completed_successfully
labels:
co.elastic.logs/module: elasticsearch
x-es-common-env: &es-common-env
CLUSTER_NAME: ${ES_CLUSTER_NAME}
ELASTIC_PASSWORD: ${ELASTIC_PASSWORD}
LICENSE: ${LICENSE}
# NOTE: Set to false if using Docker in rootless mode
MEMORY_LOCK: true
discovery.type: multi-node
discovery.seed_hosts: "es01,es02,es03"
services:
# NOTE: All other settings are inherited from the main `compose.yaml` file
setup-certs:
volumes:
- ./certs/instances-multi.yml:/usr/share/elasticsearch/config/instances.yml:ro
# NOTE: All other settings are inherited from the main `compose.yaml` file
es01:
environment:
discovery.type: multi-node
discovery.seed_hosts: "es01,es02,es03"
es02:
<<: *es-common
volumes:
- ./elasticsearch/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro
- ./certs/entities/ca_pub/:/usr/share/elasticsearch/config/certs/ca:ro
- ./certs/entities/es02/:/usr/share/elasticsearch/config/certs/es02:ro
- ./snapshots/:/usr/share/elasticsearch/snapshots
- es02_data:/usr/share/elasticsearch/data
environment:
<<: *es-common-env
NODE_NAME: es02
es03:
<<: *es-common
volumes:
- ./elasticsearch/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro
- ./certs/entities/ca_pub/:/usr/share/elasticsearch/config/certs/ca:ro
- ./certs/entities/es03/:/usr/share/elasticsearch/config/certs/es03:ro
- ./snapshots/:/usr/share/elasticsearch/snapshots
- es03_data:/usr/share/elasticsearch/data
environment:
<<: *es-common-env
NODE_NAME: es03
# NOTE: For the services below, all other settings are inherited from the main `compose.yaml` file
kibana:
environment:
ES_HOSTS: '["https://es01:9200","https://es02:9200","https://es03:9200"]'
logstash:
environment:
ES_HOSTS: "https://es01:9200 https://es02:9200 https://es03:9200"
filebeat:
environment:
ES_HOSTS: '["https://es01:9200","https://es02:9200","https://es03:9200"]'
heartbeat:
environment:
ES_HOSTS: '["https://es01:9200","https://es02:9200","https://es03:9200"]'
volumes:
es02_data:
es03_data: