# ElasticSearch - DockerSwarm : Unable to discover nodes in cluster

**URL:** <https://discuss.elastic.co/t/elasticsearch-dockerswarm-unable-to-discover-nodes-in-cluster/232330>\
**Category:** Elasticsearch\
**Created:** [May 12, 2020, 11:01pm UTC](https://discuss.elastic.co/t/elasticsearch-dockerswarm-unable-to-discover-nodes-in-cluster/232330 "2020-05-12T23:01:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![elk5](https://avatars.discourse-cdn.com/v4/letter/e/ecccb3/32.png) [@elk5](https://discuss.elastic.co/u/elk5)\
**Post date:** [May 12, 2020, 11:01pm UTC](https://discuss.elastic.co/t/elasticsearch-dockerswarm-unable-to-discover-nodes-in-cluster/232330/1 "2020-05-12T23:01:51Z")

</div>

Hi,

I am trying to configure elasticsearch and kibana on 3-node docker swarm. Here is the compose yaml file being used:

==========  
version: '3.3'  
services:  
elastic01:  
image: [docker.elastic.co/elasticsearch/elasticsearch:7.6.2](http://docker.elastic.co/elasticsearch/elasticsearch:7.6.2)  
container\_name: elastic01  
volumes:

- kesdata01:/usr/share/elasticsearch  
ports:
- 9200:9200
- 9300:9300  
environment:
- [node.name](http://node.name)=192.xxx.x.xxx -----\> // IP Address Host1
- [cluster.name](http://cluster.name)=elk
- discovery.seed\_hosts=IP Address Host2,IP Address Host3
- cluster\_initial\_master\_nodes=IP Address Host2,IP Address Host3,IP Address Host1
- "ES\_JAVA\_OPTS=-Xms256m -Xmx256m"
- bootstrap.memory\_lock=false

elastic02:  
image: [docker.elastic.co/elasticsearch/elasticsearch:7.6.2](http://docker.elastic.co/elasticsearch/elasticsearch:7.6.2)  
container\_name: elastic02  
volumes:

- kesdata02:/usr/share/elasticsearch  
environment:
- [node.name](http://node.name)=192.xxx.x.xxx
- [cluster.name](http://cluster.name)=elk
- discovery.seed\_hosts=IP Address Host3,IP Address Host1
- cluster\_initial\_master\_nodes=IP Address Host2,IP Address Host3,IP Address Host1
- "ES\_JAVA\_OPTS=-Xms256m -Xmx256m"
- bootstrap.memory\_lock=false

elastic03:  
image: [docker.elastic.co/elasticsearch/elasticsearch:7.6.2](http://docker.elastic.co/elasticsearch/elasticsearch:7.6.2)  
container\_name: elastic03  
volumes:

- kesdata03:/usr/share/elasticsearch  
environment:
- [node.name](http://node.name)=192.xxx.x.xxx
- [cluster.name](http://cluster.name)=elk
- discovery.seed\_hosts=IP Address Host2,IP Address Host1
- cluster\_initial\_master\_nodes=IP Address Host2,IP Address Host3,IP Address Host1
- "ES\_JAVA\_OPTS=-Xms256m -Xmx256m"
- bootstrap.memory\_lock=false

kibana01:  
image: [docker.elastic.co/kibana/kibana:7.6.2](http://docker.elastic.co/kibana/kibana:7.6.2)  
container\_name: kibana01  
volumes:

- kibgit:/usr/share/kibana  
ports:
- "5601:5601"  
environment:  
ELASTICSEARCH\_HOSTS: [http://IP](http://IP) Address Host1:9200  
ELASTICSEARCH\_URL: [http://IP](http://IP) Address Host1:9200  
depends\_on:
- elastic01
- elastic02
- elastic03  
=================

The containers are running fine and the elasticsearch on those are running without any issue. But the master node is not elected and the nodes are not discovered. Here is the same log:

"at java.lang.Thread.run(Thread.java:830) [?:?]"] }  
{"type": "server", "timestamp": "2020-05-12T22:38:11,065Z", "level": "DEBUG", "component": "o.e.a.s.m.TransportMasterNodeAction", "[cluster.name](http://cluster.name)": "elk", "[node.name](http://node.name)": "192.xxx.x.xxx", "message": "timed out while retrying [indices:admin/get] after failure (timeout [30s])" }

{"type": "server", "timestamp": "2020-05-12T22:38:13,566Z", "level": "DEBUG", "component": "o.e.a.s.m.TransportMasterNodeAction", "[cluster.name](http://cluster.name)": "elk", "[node.name](http://node.name)": "192.xxx.x.xxx", "message": "no known master node, scheduling a retry" }

==========  
And when I check the cluster status, here is the error received:

{ "error" : { "root\_cause" : [{ "type" : "master\_not\_discovered\_exception", "reason" : null }], "type" : "master\_not\_discovered\_exception", "reason" : null }, "status" : 503 }

Can you please help me out in resolving this issue as to why the master node is not getting elected and other nodes discovered. Do I need to add any additional parameters in my compose yaml file?  
Thanks in advance

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 9, 2020, 11:06pm UTC](https://discuss.elastic.co/t/elasticsearch-dockerswarm-unable-to-discover-nodes-in-cluster/232330/2 "2020-06-09T23:06:52Z")

</div>

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