Elasticsearch cluster on Docker for production on different phisical servers

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
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
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
{"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

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