forked from zentity-io/zentity
-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.cluster.yml
114 lines (104 loc) · 3.17 KB
/
docker-compose.cluster.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
version: '3.7'
x-plugin-volume: &plugin-volume "./target/releases/:/plugins"
x-base-es: &base-es
image: docker.elastic.co/elasticsearch/elasticsearch-oss:${ELASTICSEARCH_VERSION:-7.10.2}
user: "elasticsearch"
# install all plugins in mounted /plugin directory and start the elasticsearch server
command:
- /bin/bash
- -c
- ls /plugins/*.zip | xargs -n 1 echo 'file://' | tr -d " " | xargs elasticsearch-plugin install --batch && elasticsearch
# swap for upstream plugin
# - elasticsearch-plugin install --batch https://github.com/zentity-io/zentity/releases/download/zentity-1.6.1/zentity-1.6.1-elasticsearch-7.10.1.zip && elasticsearch
ulimits:
nofile:
soft: 65536
hard: 65536
memlock:
soft: -1
hard: -1
environment: &base-env
cluster.name: docker-cluster
network.host: 0.0.0.0
# minimum_master_nodes need to be explicitly set when bound on a public IP
# set to 1 to allow single node clusters
# Details: https://github.com/elastic/elasticsearch/pull/17288
discovery.zen.minimum_master_nodes: "1"
# Reduce virtual memory requirements, see https://github.com/docker/for-win/issues/5202#issuecomment-637782971
bootstrap.memory_lock: "false"
ES_JAVA_OPTS: "-Xms512m -Xmx512m -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0.0.0.0:5050"
http.cors.enabled: "true"
http.cors.allow-origin: "*"
cluster.initial_master_nodes: primary
networks:
- elastic
x-base-primary-node: &base-primary-node
<<: *base-es
environment:
<<: *base-env
node.name: primary
node.master: "true"
node.data: "false"
node.ingest: "false"
x-base-data-node: &base-data-node
<<: *base-es
environment:
<<: *base-env
discovery.zen.ping.unicast.hosts: elasticsearch
node.master: "false"
node.data: "true"
node.ingest: "true"
services:
elasticsearch:
<<: *base-primary-node
hostname: elasticsearch
container_name: elasticsearch
volumes:
- *plugin-volume
- es-primary:/usr/share/elasticsearch/data
ports:
- "${ES_PORT:-9200}:9200" # http
- "${DEBUGGER_PORT:-5050}:5050" # debugger
es-data-1:
<<: *base-data-node
hostname: es-data-1
container_name: es-data-1
volumes:
- *plugin-volume
- es-data-1:/usr/share/elasticsearch/data
ports:
- "${ES_PORT_DATA_1:-9201}:9200" # http
- "${DEBUGGER_PORT_DATA_1:-5051}:5050" # debugger
es-data-2:
<<: *base-data-node
hostname: es-data-2
container_name: es-data-2
volumes:
- *plugin-volume
- es-data-2:/usr/share/elasticsearch/data
ports:
- "${ES_PORT_DATA_2:-9202}:9200" # http
- "${DEBUGGER_PORT_DATA_2:-5052}:5050" # debugger
kibana:
image: docker.elastic.co/kibana/kibana-oss:${KIBANA_VERSION:-7.10.2}
hostname: kibana
container_name: kibana
logging:
driver: none
environment:
- server.host=0.0.0.0
- server.name=kibana.local
- elasticsearch.url=http://elasticsearch:9200
ports:
- '${KIBANA_PORT:-5601}:5601'
networks:
- elastic
volumes:
es-primary:
driver: local
es-data-1:
driver: local
es-data-2:
driver: local
networks:
elastic: