Docker container receive "master not discovered exception" after authentication

I'm setting up elastic search production docker-compose environment, I copied exactly the same as in the official website here. Everything worked fine after deploy. When I add ELASTIC_PASSWORD env with xpack enable and xpack trial generated license.

My docker container results in master_not_discovered_exception in /_cluster/health.

{
  "error": {
    "root_cause": [
      {
        "type": "master_not_discovered_exception",
        "reason": null
      }
    ],
    "type": "master_not_discovered_exception",
    "reason": null
  },
  "status": 503
}

Docker-compose.yml

version: '2.2'
services:
  es01:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.0.0
    container_name: es01
    environment:
      - ELASTIC_PASSWORD=elastic_password
      - xpack.security.enabled=true
      - xpack.license.self_generated.type=trial
      - discovery.seed_hosts=es02
      - node.name=es01
      - cluster.initial_master_nodes=es01,es02
      - cluster.name=docker-cluster
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - esdata01:/usr/share/elasticsearch/data
    ports:
      - 9200:9200
    networks:
      - esnet
      - traefik-public
  es02:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.0.0
    container_name: es02
    environment:
      - ELASTIC_PASSWORD=elastic_password
      - xpack.security.enabled=true
      - xpack.license.self_generated.type=trial
      - node.name=es02
      - discovery.seed_hosts=es01
      - cluster.initial_master_nodes=es01,es02
      - cluster.name=docker-cluster
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - esdata02:/usr/share/elasticsearch/data
    networks:
      - esnet

Hi @abelchun,

I tried with your docker-compose.yml file and it works fine for me. I just had to add the volumes and networks configuration for defaults.
I think you may have some docker-networking configuration which might be impacting cluster formation but without knowing what error you are getting its difficult to tell.
Could you please post the logs, that might help us better understand what might be going on?

Thanks and Regards,
Yogesh Gaikwad

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