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