Created
December 14, 2017 15:56
-
-
Save patrickleet/5752efbc45af5f4ee49e23fb2ea2b42b to your computer and use it in GitHub Desktop.
docker stack for elasticsearch cluster
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3" | |
networks: | |
default: | |
proxy: | |
external: true | |
volumes: | |
esv1: | |
driver: cloudstor:aws | |
driver_opts: | |
ebstype: gp2 | |
size: 500 | |
backing: relocatable | |
external: false | |
esv2: | |
driver: cloudstor:aws | |
driver_opts: | |
ebstype: gp2 | |
size: 500 | |
backing: relocatable | |
external: false | |
esv3: | |
driver: cloudstor:aws | |
driver_opts: | |
ebstype: gp2 | |
size: 500 | |
backing: relocatable | |
external: false | |
services: | |
elasticsearch: | |
image: docker.elastic.co/elasticsearch/elasticsearch:5.2.2 | |
environment: | |
node.name: elasticsearch | |
node.master: "true" | |
node.data: "false" | |
node.ingest: "false" | |
cluster.name: logging-elasticsearch | |
network.host: 0.0.0.0 | |
discovery.zen.ping.unicast.hosts: elasticsearch,elasticsearch2,elasticsearch3,esdata1,esdata2,esdata3 | |
discovery.zen.minimum_master_nodes: 2 | |
xpack.security.enabled: "false" | |
path.data: /usr/share/elasticsearch/data | |
path.logs: /usr/share/elasticsearch/logs | |
# bootstrap.memory_lock: "true" | |
MAX_LOCKED_MEMORY: unlimited | |
ES_JAVA_OPTS: "-Xms1700M -Xmx1700M -Djava.io.tmpdir=/usr/share/elasticsearch/tmp" | |
ulimits: | |
memlock: | |
soft: -1 | |
hard: -1 | |
nofile: | |
soft: 65536 | |
hard: 65536 | |
networks: | |
- default | |
deploy: | |
placement: | |
constraints: | |
- node.labels.for == es-master-a | |
resources: | |
limits: | |
memory: 3.4G | |
reservations: | |
memory: 3.4G | |
restart_policy: | |
delay: 30s | |
elasticsearch2: | |
image: docker.elastic.co/elasticsearch/elasticsearch:5.2.2 | |
environment: | |
node.name: elasticsearch2 | |
node.master: "true" | |
node.data: "false" | |
node.ingest: "false" | |
cluster.name: logging-elasticsearch | |
network.host: 0.0.0.0 | |
discovery.zen.ping.unicast.hosts: elasticsearch,elasticsearch2,elasticsearch3,esdata1,esdata2,esdata3 | |
discovery.zen.minimum_master_nodes: 2 | |
xpack.security.enabled: "false" | |
path.data: /usr/share/elasticsearch/data | |
path.logs: /usr/share/elasticsearch/logs | |
# bootstrap.memory_lock: "true" | |
MAX_LOCKED_MEMORY: unlimited | |
ES_JAVA_OPTS: "-Xms1700M -Xmx1700M -Djava.io.tmpdir=/usr/share/elasticsearch/tmp" | |
ulimits: | |
memlock: | |
soft: -1 | |
hard: -1 | |
nofile: | |
soft: 65536 | |
hard: 65536 | |
networks: | |
- default | |
deploy: | |
placement: | |
constraints: | |
- node.labels.for == es-master-b | |
resources: | |
limits: | |
memory: 3.4G | |
reservations: | |
memory: 3.4G | |
restart_policy: | |
delay: 30s | |
elasticsearch3: | |
image: docker.elastic.co/elasticsearch/elasticsearch:5.2.2 | |
environment: | |
node.name: elasticsearch3 | |
node.master: "true" | |
node.data: "false" | |
node.ingest: "false" | |
cluster.name: logging-elasticsearch | |
network.host: 0.0.0.0 | |
discovery.zen.ping.unicast.hosts: elasticsearch,elasticsearch2,elasticsearch3,esdata1,esdata2,esdata3 | |
discovery.zen.minimum_master_nodes: 2 | |
xpack.security.enabled: "false" | |
path.data: /usr/share/elasticsearch/data | |
path.logs: /usr/share/elasticsearch/logs | |
# bootstrap.memory_lock: "true" | |
MAX_LOCKED_MEMORY: unlimited | |
ES_JAVA_OPTS: "-Xms1700M -Xmx1700M -Djava.io.tmpdir=/usr/share/elasticsearch/tmp" | |
ulimits: | |
memlock: | |
soft: -1 | |
hard: -1 | |
nofile: | |
soft: 65536 | |
hard: 65536 | |
networks: | |
- default | |
deploy: | |
placement: | |
constraints: | |
- node.labels.for == es-master-c | |
resources: | |
limits: | |
memory: 3.4G | |
reservations: | |
memory: 3.4G | |
restart_policy: | |
delay: 30s | |
esdata1: | |
image: docker.elastic.co/elasticsearch/elasticsearch:5.2.2 | |
environment: | |
node.name: esdata1 | |
node.master: "false" | |
node.data: "true" | |
node.ingest: "true" | |
cluster.name: logging-elasticsearch | |
network.host: 0.0.0.0 | |
discovery.zen.ping.unicast.hosts: elasticsearch,elasticsearch2,elasticsearch3,esdata1,esdata2,esdata3 | |
discovery.zen.minimum_master_nodes: 2 | |
xpack.security.enabled: "false" | |
path.data: /usr/share/elasticsearch/data | |
path.logs: /usr/share/elasticsearch/logs | |
# bootstrap.memory_lock: "true" | |
MAX_LOCKED_MEMORY: unlimited | |
ES_JAVA_OPTS: "-Xms1700M -Xmx1700M -Djava.io.tmpdir=/usr/share/elasticsearch/tmp" | |
ulimits: | |
memlock: | |
soft: -1 | |
hard: -1 | |
nofile: | |
soft: 65536 | |
hard: 65536 | |
networks: | |
- default | |
volumes: | |
- esv1:/usr/share/elasticsearch/data | |
deploy: | |
placement: | |
constraints: | |
- node.labels.for == es-data-a | |
resources: | |
limits: | |
memory: 3.4G | |
reservations: | |
memory: 3.4G | |
restart_policy: | |
delay: 30s | |
esdata2: | |
image: docker.elastic.co/elasticsearch/elasticsearch:5.2.2 | |
environment: | |
node.name: esdata2 | |
node.master: "false" | |
node.data: "true" | |
node.ingest: "true" | |
cluster.name: logging-elasticsearch | |
network.host: 0.0.0.0 | |
discovery.zen.ping.unicast.hosts: elasticsearch,elasticsearch2,elasticsearch3,esdata1,esdata2,esdata3 | |
discovery.zen.minimum_master_nodes: 2 | |
xpack.security.enabled: "false" | |
path.data: /usr/share/elasticsearch/data | |
path.logs: /usr/share/elasticsearch/logs | |
# bootstrap.memory_lock: "true" | |
MAX_LOCKED_MEMORY: unlimited | |
ES_JAVA_OPTS: "-Xms1700M -Xmx1700M -Djava.io.tmpdir=/usr/share/elasticsearch/tmp" | |
ulimits: | |
memlock: | |
soft: -1 | |
hard: -1 | |
nofile: | |
soft: 65536 | |
hard: 65536 | |
networks: | |
- default | |
volumes: | |
- esv2:/usr/share/elasticsearch/data | |
deploy: | |
placement: | |
constraints: | |
- node.labels.for == es-data-b | |
resources: | |
limits: | |
memory: 3.4G | |
reservations: | |
memory: 3.4G | |
restart_policy: | |
delay: 30s | |
esdata3: | |
image: docker.elastic.co/elasticsearch/elasticsearch:5.2.2 | |
environment: | |
node.name: esdata3 | |
node.master: "false" | |
node.data: "true" | |
node.ingest: "true" | |
cluster.name: logging-elasticsearch | |
network.host: 0.0.0.0 | |
discovery.zen.ping.unicast.hosts: elasticsearch,elasticsearch2,elasticsearch3,esdata1,esdata2,esdata3 | |
discovery.zen.minimum_master_nodes: 2 | |
xpack.security.enabled: "false" | |
path.data: /usr/share/elasticsearch/data | |
path.logs: /usr/share/elasticsearch/logs | |
# bootstrap.memory_lock: "true" | |
MAX_LOCKED_MEMORY: unlimited | |
ES_JAVA_OPTS: "-Xms1700M -Xmx1700M -Djava.io.tmpdir=/usr/share/elasticsearch/tmp" | |
ulimits: | |
memlock: | |
soft: -1 | |
hard: -1 | |
nofile: | |
soft: 65536 | |
hard: 65536 | |
networks: | |
- default | |
volumes: | |
- esv3:/usr/share/elasticsearch/data | |
deploy: | |
placement: | |
constraints: | |
- node.labels.for == es-data-c | |
resources: | |
limits: | |
memory: 3.4G | |
reservations: | |
memory: 3.4G | |
restart_policy: | |
delay: 30s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment