-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
138 lines (134 loc) · 4.18 KB
/
docker-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
# Cluster environment to use to learn and practice for the Elastic Certified Engineer exam.
# This was originally based on "elastic-training-repo" by Guido Lena Cota (@glenacota): https://github.com/glenacota/elastic-training-repo
#
# This uses Elastic Stack 7.13.4
# The exam as of July 2021 uses Elastic Stack 7.13.4
#
# Nodes:
# 1 master node,
# 2 data nodes
# 1 ingest node
# 1 Kibana instance
#
# The two data nodes support a hot/warm architecture
#
# NOTE: the volumes persist even when containers are removed (e.g. "docker-compose down")
# To clean them up, run "docker volume prune"
#
# TODOs:
# - Mount a log4j2.properties file to one of the data nodes (as an example/ability to play with)
# - Mount a jvm.options file to one of the data nodes (as an example/ability to play with)
# - Add path.repo to configuration and add a volume mount for Snapshots
# - Add a second "remote cluster" to practice CCS/CCR (Cross-Cluster Search/Cross-Cluster Replication)
# - configure monitoring
# - Add a monitoring cluster
# - add metricbeat for this cluster
# - add filebeat for this cluster
# - Enable security, so Roles and Users can be configured from Kibana for practice
version: '3'
services:
master:
image: docker.elastic.co/elasticsearch/elasticsearch:7.13.4
container_name: master
environment:
- ES_JAVA_OPTS=-Xms512m -Xmx512m
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- master-data:/usr/share/elasticsearch/data
- ./config/master/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro
ports:
- 9200:9200
networks:
- elastic-net
datanode-europe:
image: docker.elastic.co/elasticsearch/elasticsearch:7.13.4
container_name: datanode-europe
environment:
- ES_JAVA_OPTS=-Xms512m -Xmx512m
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- datanode-europe-data:/usr/share/elasticsearch/data
- ./config/datanode-europe/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro
networks:
- elastic-net
datanode-asia:
image: docker.elastic.co/elasticsearch/elasticsearch:7.13.4
container_name: datanode-asia
environment:
# Leave config for this node as environment variables as an example
- cluster.name=learning-cluster
- cluster.initial_master_nodes=master
- discovery.seed_hosts=master
- node.name=datanode-asia
- node.roles=data
- node.attr.my_zone=asia
- xpack.security.enabled=false
- bootstrap.memory_lock=true
- xpack.license.self_generated.type=basic
- ES_JAVA_OPTS=-Xms512m -Xmx512m
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- datanode-asia-data:/usr/share/elasticsearch/data
# NOTE: no config file here so there is an example of
# configuring a node using environment variables.
networks:
- elastic-net
ingestnode:
image: docker.elastic.co/elasticsearch/elasticsearch:7.13.4
container_name: ingestnode
environment:
# Leave as environment variables as an example
- cluster.name=learning-cluster
- cluster.initial_master_nodes=master
- discovery.seed_hosts=master
- node.name=ingestnode
- node.roles=ingest
- xpack.security.enabled=false
- bootstrap.memory_lock=true
- xpack.license.self_generated.type=basic
- ES_JAVA_OPTS=-Xms512m -Xmx512m
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- ingestnode-data:/usr/share/elasticsearch/data
# NOTE: no config file here so there is an example of
# configuring a node using environment variables.
networks:
- elastic-net
kibana:
image: docker.elastic.co/kibana/kibana:7.13.4
container_name: kibana
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- ./config/kibana.yml:/usr/share/kibana/config/kibana.yml:ro
ports:
- 5601:5601
networks:
- elastic-net
links:
- datanode-europe:elasticsearch
volumes:
master-data:
driver: local
datanode-europe-data:
driver: local
datanode-asia-data:
driver: local
ingestnode-data:
driver: local
networks:
elastic-net: