# Elastic Cluster Fails on Docker Swarm

**URL:** <https://discuss.elastic.co/t/elastic-cluster-fails-on-docker-swarm/232392>\
**Category:** Elasticsearch\
**Created:** [May 13, 2020, 8:37am UTC](https://discuss.elastic.co/t/elastic-cluster-fails-on-docker-swarm/232392 "2020-05-13T08:37:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![msaik3](https://avatars.discourse-cdn.com/v4/letter/m/e47c2d/32.png) [@msaik3](https://discuss.elastic.co/u/msaik3)\
**Post date:** [May 13, 2020, 8:37am UTC](https://discuss.elastic.co/t/elastic-cluster-fails-on-docker-swarm/232392/1 "2020-05-13T08:37:17Z")

</div>

Hi,

I'm trying to Deploy Elasticsearch on a 3 node Swarm cluster.  
with Elasticsearch -3 replicas.

I'm using the following docker compose file for it:

elastic\_compose.yml  
version: "3.7"  
services:  
elasticsearch:  
image: [docker.elastic.co/elasticsearch/elasticsearch:7.6.2](http://docker.elastic.co/elasticsearch/elasticsearch:7.6.2)  
hostname: "{{.Node.Hostname}}"  
environment:  
- node.name={{.Node.Hostname}}  
- cluster.name=elk  
- "ES\_JAVA\_OPTS=-Xms2g -Xmx2g"  
- network.host=0.0.0.0  
- discovery.seed\_hosts=elasticsearch  
- cluster.initial\_master\_nodes='host1,host2'  
- node.ml=false  
- xpack.ml.enabled=false  
- xpack.monitoring.enabled=false  
- xpack.security.enabled=false  
- xpack.watcher.enabled=false  
- bootstrap.memory\_lock=false  
volumes:  
- edata:/usr/share/elasticsearch/data  
deploy:  
mode: global  
endpoint\_mode: dnsrr

volumes:  
edata:  
driver: local

I could see all replica's running.. but, from my container logs I see the following WARN:

{"type": "server", "timestamp": "2020-05-13T08:28:35,380Z", "level": "WARN", "component": "o.e.c.c.ClusterFormationFailureHelper", "cluster.name": "elk", "node.name": "hostname1", "message": "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and this node must discover master-eligible nodes ['hostname1, hostname2, hostname3'] to bootstrap a cluster: have discovered [{hostname1}{OG54ixTKTu2UawYRbdF0rQ}{i58wyiHkSbiawLQsRY32Tw}{10.0.24.3}{10.0.24.3:9300}{dim}{xpack.installed=true}]; discovery will continue using from hosts providers and [{hostname1}{OG54ixTKTu2UawYRbdF0rQ}{i58wyiHkSbiawLQsRY32Tw}{10.0.24.3}{10.0.24.3:9300}{dim}{xpack.installed=true}] from last-known cluster state; node term 0, last-accepted version 0 in term 0" }

and when I check for the cluster status it says:  
curl: (7) Failed connect to xxx.xxx.x.x:9200; Connection refused

but, I can see docker service ls result as all 3 ES running:  
ID NAME MODE REPLICAS IMAGE PORTS  
ptve6uuehj19 nee\_elasticsearch global 3/3 [docker.elastic.co/elasticsearch/elasticsearch:7.6.2](http://docker.elastic.co/elasticsearch/elasticsearch:7.6.2)

Could anyone of you please help me in understanding this or any possible solutions if you have.  
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 10, 2020, 8:37am UTC](https://discuss.elastic.co/t/elastic-cluster-fails-on-docker-swarm/232392/2 "2020-06-10T08:37:30Z")

</div>

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