Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
3 Node Elasticsearch Cluster for Docker
version: '2'
services:
es0:
container_name: es0
image: docker.elastic.co/elasticsearch/elasticsearch:6.8.6
container_name: es0
environment:
- ES_SKIP_SET_KERNEL_PARAMETERS=true
- cluster.name=docker-cluster
- node.name=es0
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms256m -Xmx256m"
- "discovery.zen.ping.unicast.hosts=es1,es2"
- "discovery.zen.minimum_master_nodes=2"
- "xpack.security.enabled=false"
- "xpack.watcher.enabled=false"
- "xpack.monitoring.enabled=false"
ulimits:
memlock:
soft: -1
hard: -1
mem_limit: 1g
volumes:
- esvol0:/usr/share/elasticsearch/data
ports:
- 9200:9200
networks:
- esnet
es1:
container_name: es1
image: docker.elastic.co/elasticsearch/elasticsearch:6.8.6
environment:
- ES_SKIP_SET_KERNEL_PARAMETERS=true
- cluster.name=docker-cluster
- node.name=es1
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms256m -Xmx256m"
- "discovery.zen.ping.unicast.hosts=es0,es2"
- "discovery.zen.minimum_master_nodes=2"
- "xpack.security.enabled=false"
- "xpack.watcher.enabled=false"
- "xpack.monitoring.enabled=false"
depends_on:
- es0
ulimits:
memlock:
soft: -1
hard: -1
mem_limit: 1g
volumes:
- esvol1:/usr/share/elasticsearch/data
networks:
- esnet
es2:
container_name: es2
image: docker.elastic.co/elasticsearch/elasticsearch:6.8.6
environment:
- ES_SKIP_SET_KERNEL_PARAMETERS=true
- cluster.name=docker-cluster
- node.name=es2
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms256m -Xmx256m"
- "discovery.zen.ping.unicast.hosts=es0,es1"
- "discovery.zen.minimum_master_nodes=2"
- "xpack.security.enabled=false"
- "xpack.watcher.enabled=false"
- "xpack.monitoring.enabled=false"
depends_on:
- es0
ulimits:
memlock:
soft: -1
hard: -1
mem_limit: 1g
volumes:
- esvol2:/usr/share/elasticsearch/data
networks:
- esnet
kibana:
container_name: kibana
image: docker.elastic.co/kibana/kibana:6.8.6
ports:
- 5601:5601
environment:
- "ELASTICSEARCH_URL=http://es0:9200"
ports:
- 5601:5601
links:
- es0
networks:
- esnet
networks:
esnet: {}
volumes:
esvol0:
driver: local
esvol1:
driver: local
esvol2:
driver: local
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.