Elastic cluster on Docker swarm

Hello :smiley:
Unfortunately Im going to ask a common question on elastic cluster, but for some unkown reason that I found pretty strange, there is no answer at the moment.
Im trying to deploy elastic cluster on 3 docker nodes (will leave the stack below) and it is just dont work.
What I was able to find out by myself, beyond that the stack is working well if I use docker-compose up, is that if I deploy the stack on the swarm WITHOUT any port configuration it does work, but if I deploy with port (like the stack below) the manager just cannot connect to node with the specified port.

I believe that I read every topic and the whole documentation about it, yet - no answer.
Thank you for any respond :wink:

this is the compose file I try to deploy:

version: "3.7"

services:
   es01:
    image: docker.elastic.co/elasticsearch/elasticsearch:8.11.0
    ports:
      - 9200:9200
    environment:
      - node.name=es01
      - ES_JAVA_OPTS=-Xmx1024m -Xms1024m
      - cluster.name=cluster
      - cluster.initial_master_nodes=es01,es02,es03
      - discovery.seed_hosts=es02,es03
      - ELASTIC_PASSWORD=123456
      - bootstrap.memory_lock=true
      - xpack.security.enabled=false
      - xpack.security.http.ssl.enabled=false
      - xpack.security.transport.ssl.enabled=false
    ulimits:
      memlock:
        soft: -1
        hard: -1
   es02:
    depends_on:
      - es01
    image: docker.elastic.co/elasticsearch/elasticsearch:8.11.0
    environment:
      - node.name=es02
      - ES_JAVA_OPTS=-Xmx1024m -Xms1024m
      - cluster.name=cluster
      - cluster.initial_master_nodes=es01,es02,es03
      - discovery.seed_hosts=es02,es03
      - ELASTIC_PASSWORD=123456
      - bootstrap.memory_lock=true
      - xpack.security.enabled=false
      - xpack.security.http.ssl.enabled=false
      - xpack.security.transport.ssl.enabled=false
    ulimits:
      memlock:
        soft: -1
        hard: -1
   es03:
    depends_on:
      - es02
    image: docker.elastic.co/elasticsearch/elasticsearch:8.11.0
    environment:
      - node.name=es03
      - ES_JAVA_OPTS=-Xmx1024m -Xms1024m
      - cluster.name=cluster
      - cluster.initial_master_nodes=es01,es02,es03
      - discovery.seed_hosts=es02,es03
      - ELASTIC_PASSWORD=123456
      - bootstrap.memory_lock=true
      - xpack.security.enabled=false
      - xpack.security.http.ssl.enabled=false
      - xpack.security.transport.ssl.enabled=false
    ulimits:
      memlock:
        soft: -1
        hard: -1

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