Multi host elasticsearch cluster using docker

Hello everyone,

I am trying to configure elasticsearch cluster on docker with 3 different hosts which are identical. Any one of these should be master/data nodes. I have the following docker-compose.yml file. I am getting error master node not found and bootstrap cluster discovery shows empty. Can some one please check and see where I am doing wrong? I have tried replacing host1,host2, host3 with IP and FQDN with no luck. I can reach host1, host2, host3 external to docker container.

docker-compose.yml:

version: '2.2'
services:
es01:
image: docker.elastic.co/elasticsearch/elasticsearch:7.1.1
container_name: es01
environment:
- node.name=host1
- node.data=true
- discovery.seed_hosts=host1,host2,host3
- cluster.initial_master_nodes=host1,host2,host3
- cluster.name=ELK_Prod
- node.master=true
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms1024m -Xmx1024m"
- Des.discovery.zen.ping.unicast.hosts=host1,host2,host3
- Des.discovery.zen.minimum_master_nodes=1
- Des.network.publish_host=host1
- transport.tcp.port=9300
- http.port=9200
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- esdata01:/elkstack/elasticsearch/elasticsearch-7.1.1/data
networks:
- esnet1

volumes:
esdata01:
driver: local

networks:
esnet1:

Warning Message:

{"type": "server", "timestamp": "2019-06-20T00:34:03,059+0000", "level": "WARN", "component": "o.e.c.c.ClusterFormationFailureHelper", "cluster.name": "ELK_Prod", "node.name": "host1", "message": "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and this node must discover master-eligible nodes [host1,host2,host3] to bootstrap a cluster: have discovered ; discovery will continue using [152.102.42.172:9300, 152.102.42.170:9300, 152.102.28.45:9300] from hosts providers and [{host1}{lP8KDiM8Q9WdOFqFIWvRxQ}{Il7ncUxWTsKUWxhaDn6tCQ}{172.20.0.2}{172.20.0.2:9300}{ml.machine_memory=25092349952, xpack.installed=true, ml.max_open_jobs=20}] from last-known cluster state; node term 0, last-accepted version 0 in term 0" }

Thanks

Hi @nila

I assume you are trying to do it with Docker-Compose, correct? What I would do is the following:
Make a service for each host you want to run as part of the ELK-Stack. You can use the configuration file (docker-compose.yml) provided in this guide.

Hope this helps.

MiTschMR

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.