Skip to content

Instantly share code, notes, and snippets.

@broland07
Created March 25, 2023 15:12
Show Gist options
  • Save broland07/f41617264291652819044ec8c67f100a to your computer and use it in GitHub Desktop.
Save broland07/f41617264291652819044ec8c67f100a to your computer and use it in GitHub Desktop.
Elasticsearch simple 3 node cluster on 3 machine with docker-compose
version: "3.8"
services:
es-1:
image: docker.elastic.co/elasticsearch/elasticsearch:7.8.0
volumes:
- ./elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
ports:
- "9200:9200"
- "9300:9300"
ulimits:
memlock:
soft: -1
hard: -1
cluster.name: "docker-cluster"
network.host: 0.0.0.0
discovery.seed_hosts: "192.168.0.28,192.168.0.29"
node.name: "es-1"
network.publish_host: 192.168.0.27
cluster.initial_master_nodes: "es-1,es-2,es-3"
version: "3.8"
services:
es-2:
image: docker.elastic.co/elasticsearch/elasticsearch:7.8.0
volumes:
- ./elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
ports:
- "9200:9200"
- "9300:9300"
ulimits:
memlock:
soft: -1
hard: -1
cluster.name: "docker-cluster"
network.host: 0.0.0.0
discovery.seed_hosts: "192.168.0.27,192.168.0.29"
node.name: "es-2"
network.publish_host: 192.168.0.28
cluster.initial_master_nodes: "es-1,es-2,es-3"
version: "3.8"
services:
es-3:
image: docker.elastic.co/elasticsearch/elasticsearch:7.8.0
volumes:
- ./elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
ports:
- "9200:9200"
- "9300:9300"
ulimits:
memlock:
soft: -1
hard: -1
cluster.name: "docker-cluster"
network.host: 0.0.0.0
discovery.seed_hosts: "192.168.0.27,192.168.0.28"
node.name: "es-3"
network.publish_host: 192.168.0.29
cluster.initial_master_nodes: "es-1,es-2,es-3"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment