6
votes

I pulled the elastic search image from docker and tried to run it using docker command but it didn't work. I got the following error:

ERROR: [1] bootstrap checks failed [1]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured {"type": "server", "timestamp": "2020-02-10T19:47:06,566Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "elasticsearch", "message": "stopping ..." } {"type": "server", "timestamp": "2020-02-10T19:47:06,600Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "elasticsearch", "message": "stopped" } {"type": "server", "timestamp": "2020-02-10T19:47:06,600Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "elasticsearch", "message": "closing ..." } {"type": "server", "timestamp": "2020-02-10T19:47:06,630Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "elasticsearch", "message": "closed" } {"type": "server", "timestamp": "2020-02-10T19:47:06,633Z", "level": "INFO", "component": "o.e.x.m.p.NativeController", "cluster.name": "docker-cluster", "node.name": "elasticsearch", "message": "Native controller process has stopped - no new native processes can be started" }

2
Can you reformate your error message and provide the image you pullanand

2 Answers

12
votes

Even your logs are not very right format, I understand that you are running Elasticsearch version: 7.x.
So here I believe you are missing the environment variable which needs to provide while running container.

In case you are running single-node Elasticsearch than add environment variable:
discovery.type=single-node

I would like to see your docker run command and image you are using if still this solution not works.

5
votes

Looks like you are starting docker on your local machine with production settings.

The error message is clearly saying below params are missing

bootstrap checks failed 1: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured

If you are running it locally then no need to pass these params and simply start using below command by providing the discovery.type=single-node param to bypass the production checks.

docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.6.0

EDIT:- Please go through ES Bootstrap checks to understand these params and error message in details, it would help you understand the imporatace and what these params do.