Deploy Elastic Search cluster consisting of multiple hosts using ES docker image

I want to deploy ES cluster consisting of different hosts using ES docker image.

i am running below docker-compose file on each node.

On each of the node, ES gets started. But when I access http://host:port/_cluster/health, I see a cluster with only one node on each of the host.

Is there any issue with above docker command or do I require to use Docker swarm with overlay network?

version: '2.1'
services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:6.2.4
    container_name: nces
    environment:
      - cluster.name=calsearch
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
      - "discovery.zen.ping.unicast.hosts=cal3-node,cal4-node,cal6-node"
      - "network.host=0.0.0.0"
      - "transport.host=0.0.0.0"
      - "transport.bind_host=0.0.0.0"
      - "transport.publish_host=172.17.58.14"
      - "xpack.security.enabled=false"
      - "transport.tcp.compress=true"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - esdata1:/usr/share/elasticsearch/data
    ports:
      - 9300:9300
      - 9200:9200
    expose:
      - "9200"
      - "9300"


volumes:
  esdata1:
    driver: local

What do the logs show?

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