# How to start Elasticsearch 7.0.0 in global mode in a docker swarm cluster?

**URL:** https://discuss.elastic.co/t/how-to-start-elasticsearch-7-0-0-in-global-mode-in-a-docker-swarm-cluster/178712
**Category:** Elasticsearch
**Tags:** docker
**Created:** [April 26, 2019, 7:22pm UTC](https://discuss.elastic.co/t/how-to-start-elasticsearch-7-0-0-in-global-mode-in-a-docker-swarm-cluster/178712 "2019-04-26T19:22:57Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![shazChaudhry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shazchaudhry/32/25027_2.png) [@shazChaudhry](https://discuss.elastic.co/u/shazChaudhry)
#### Post date: [April 26, 2019, 7:22pm UTC](https://discuss.elastic.co/t/how-to-start-elasticsearch-7-0-0-in-global-mode-in-a-docker-swarm-cluster/178712/1 "2019-04-26T19:22:57Z")

</div>

I have a 6 node docker swarm cluster in which I would like to have 3 elasticsearch masters. The remaining nodes will be data nodes. The elasticsearch cluster will be behind a reverse proxy.

What elasticsearch configuration will I need to set to spin up an elasticsearch cluster in docker swarm global mode? I will really appreciate any suggestion.

Here is my initial docker-compose.yml: [https://github.com/shazChaudhry/docker-elastic/blob/8a6dbfbbfab12f96d633f31215dc9fa90df5b47f/docker-compose.yml](https://github.com/shazChaudhry/docker-elastic/blob/8a6dbfbbfab12f96d633f31215dc9fa90df5b47f/docker-compose.yml)

---

<div class="post-metadata">

### Author: ![shazChaudhry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shazchaudhry/32/25027_2.png) [@shazChaudhry](https://discuss.elastic.co/u/shazChaudhry)
#### Post date: [April 26, 2019, 7:32pm UTC](https://discuss.elastic.co/t/how-to-start-elasticsearch-7-0-0-in-global-mode-in-a-docker-swarm-cluster/178712/2 "2019-04-26T19:32:18Z")

</div>

Elasticsearch 6.7.0 worked very well in global mode in a docker swarm: Here is the compose file: [https://github.com/shazChaudhry/docker-elastic/blob/2b0cc079b4a5755f3146facc3dc7827315cb1bbf/docker-compose.yml](https://github.com/shazChaudhry/docker-elastic/blob/2b0cc079b4a5755f3146facc3dc7827315cb1bbf/docker-compose.yml)

I just can not work out how to start elasticsearch 7.0.0 in global mode in docker swarm

---

<div class="post-metadata">

### Author: ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)
#### Post date: [April 26, 2019, 10:02pm UTC](https://discuss.elastic.co/t/how-to-start-elasticsearch-7-0-0-in-global-mode-in-a-docker-swarm-cluster/178712/3 "2019-04-26T22:02:21Z")

</div>

As far as I can tell, Docker Swarm doesn't offer the ability to auto-generate a set of predictable node names for the master nodes as, say, a Kubernetes StatefulSet does. This does makes bootstrapping the cluster a bit difficult. One idea: you could start with a single "bootstrap" master node with a predictable name, then add the three normal master nodes to it, then shut the bootstrap master down.

---

<div class="post-metadata">

### Author: ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)
#### Post date: [April 30, 2019, 3:30am UTC](https://discuss.elastic.co/t/how-to-start-elasticsearch-7-0-0-in-global-mode-in-a-docker-swarm-cluster/178712/4 "2019-04-30T03:30:23Z")

</div>

Another idea: you can start each of your masters as a separate service with a fixed name. This is what the suggested `docker-compose.yml` file in the [reference manual](https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html) does.

---

<div class="post-metadata">

### Author: ![shazChaudhry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shazchaudhry/32/25027_2.png) [@shazChaudhry](https://discuss.elastic.co/u/shazChaudhry)
#### Post date: [May 18, 2019, 11:48pm UTC](https://discuss.elastic.co/t/how-to-start-elasticsearch-7-0-0-in-global-mode-in-a-docker-swarm-cluster/178712/5 "2019-05-18T23:48:02Z")

</div>

Thank you very much for the suggestions. I wish there were a simpler solution.

I am not entirely sure how I am going to take Elastic stack forward with docker swarm.

---

<div class="post-metadata">

### Author: ![shazChaudhry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shazchaudhry/32/25027_2.png) [@shazChaudhry](https://discuss.elastic.co/u/shazChaudhry)
#### Post date: [June 11, 2019, 11:05pm UTC](https://discuss.elastic.co/t/how-to-start-elasticsearch-7-0-0-in-global-mode-in-a-docker-swarm-cluster/178712/6 "2019-06-11T23:05:01Z")

</div>

Here is an example showing how to start an Elasticsearch v7.x cluster in global mode in docker swarm.

This example was tried in a two-node swarm cluster; **node1** = elasticsearch master node; **node2** = data node

> <https://github.com/shazChaudhry/docker-elastic/blob/a49567673395e774510ea843d86074f1525d0fa4/docker-compose.yml>

---

<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: [July 9, 2019, 11:05pm UTC](https://discuss.elastic.co/t/how-to-start-elasticsearch-7-0-0-in-global-mode-in-a-docker-swarm-cluster/178712/7 "2019-07-09T23:05:19Z")

</div>

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