# Elasticsearch cluster on Docker for production on different phisical servers

**URL:** <https://discuss.elastic.co/t/elasticsearch-cluster-on-docker-for-production-on-different-phisical-servers/170146>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [February 27, 2019, 10:56am UTC](https://discuss.elastic.co/t/elasticsearch-cluster-on-docker-for-production-on-different-phisical-servers/170146 "2019-02-27T10:56:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![HansCama](https://avatars.discourse-cdn.com/v4/letter/h/3ec8ea/32.png) [@HansCama](https://discuss.elastic.co/u/HansCama)\
**Post date:** [February 27, 2019, 10:56am UTC](https://discuss.elastic.co/t/elasticsearch-cluster-on-docker-for-production-on-different-phisical-servers/170146/1 "2019-02-27T10:56:06Z")

</div>

HI all,  
I'm trying to setup a elasticsearch cluster on 3 different servers, connected in my company's network, using docker-compose. My docker-compose.yml looks like:

NODE 1:

version: '2'  
services:  
elasticsearch:  
image: [docker.elastic.co/elasticsearch/elasticsearch:6.6.1](http://docker.elastic.co/elasticsearch/elasticsearch:6.6.1)  
container\_name: elasticsearch  
environment:  
- cluster.name=docker-cluster  
- bootstrap.memory\_lock=true  
- node.data=true  
- network.host=0.0.0.0  
- http.cors.enabled=true  
- http.cors.allow-origin=\*  
- "ES\_JAVA\_OPTS=-Xms512m -Xmx512m"  
- discovery.zen.ping.unicast.hosts="10.150.5.34,10.150.5.35"  
- discovery.zen.ping.multicast.enabled=false  
- discovery.zen.minimum\_master\_nodes=2  
- network.publish\_host=10.150.5.34  
- node.name=prod\_es\_node1  
- node.master=true  
ulimits:  
memlock:  
soft: -1  
hard: -1  
ports:  
- 9200:9200  
- 9300:9300/udp  
command: /usr/share/elasticsearch/bin/elasticsearch

and NODE2:

version: '2'  
services:  
elasticsearch:  
image: [docker.elastic.co/elasticsearch/elasticsearch:6.6.1](http://docker.elastic.co/elasticsearch/elasticsearch:6.6.1)  
container\_name: elasticsearch  
environment:  
- cluster.name=docker-cluster  
- bootstrap.memory\_lock=true  
- node.data=true  
- network.host=0.0.0.0  
- http.cors.enabled=true  
- http.cors.allow-origin=\*  
- "ES\_JAVA\_OPTS=-Xms512m -Xmx512m"  
- discovery.zen.ping.unicast.hosts="10.150.5.34,10.150.5.35"  
- discovery.zen.ping.multicast.enabled=false  
- discovery.zen.minimum\_master\_nodes=2  
- network.publish\_host=10.150.5.35  
- node.name=prod\_es\_node2  
- node.master=false  
ulimits:  
memlock:  
soft: -1  
hard: -1  
ports:  
- 9200:9200  
- 9300:9300/udp  
command: /usr/share/elasticsearch/bin/elasticsearch

However running  
[root@elk2 ~]# curl [http://elk1:9200/\_cluster/health](http://elk1:9200/_cluster/health)  
{"cluster\_name":"docker-cluster","status":"green","timed\_out":false,"number\_of\_nodes":1,"number\_of\_data\_nodes":1,"active\_primary\_shards":0,"active\_shards":0,"relocating\_shards":0,"initializing\_shards":0,"unassigned\_shards":0,"delayed\_unassigned\_shards":0,"number\_of\_pending\_tasks":0,"number\_of\_in\_flight\_fetch":0,"task\_max\_waiting\_in\_queue\_millis":0,"active\_shards\_percent\_as\_number":100.0}

same thing when I run that check for node2.  
Anyone having the same (pretty typical) usecase? I'm running "docker-compose up" as root from both the machines.  
A question is also: am I doing the right way running docker-compose from both the servers? Do I have to use (and learn) an orchestrator?

Thanks,  
Marco

---

<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:** [March 27, 2019, 10:56am UTC](https://discuss.elastic.co/t/elasticsearch-cluster-on-docker-for-production-on-different-phisical-servers/170146/2 "2019-03-27T10:56:06Z")

</div>

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