18

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" }

Amit
  • 30,756
  • 6
  • 57
  • 88
saivishal vangala
  • 183
  • 1
  • 1
  • 7

3 Answers3

25

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.

anand
  • 741
  • 5
  • 11
  • @saivishalvangala kindly mark and upvote the answers so that others will get the benefit. – anand Feb 12 '20 at 09:28
  • can you tell me what it means discovery.type=single-node – saivishal vangala Feb 13 '20 at 12:51
  • this env says, elasticsearch is having only one node and a node will elect itself master and will not join a cluster with any other node. – anand Feb 13 '20 at 12:53
  • i am getting error when i try to connect filebeat to the elastic search container. i not understanding the reason behind the error. all of my filebeat.yml apache.yml are correct. – saivishal vangala Feb 13 '20 at 12:58
  • is setting as single-node causing the connection error between filebeat and elastic search which is earlier connected to kibana – saivishal vangala Feb 13 '20 at 13:00
  • @saivishalvangala based on your early comment I can see you thanks for the solution which worked, now you are discussing something else which is a new question. Kindly create a new question with details, sure you will get benefit from the community. And again my humble suggestion will mark the answer as accepted so that someone else will get benefit. – anand Feb 13 '20 at 13:09
  • i am unable to vote the answer as my reputation score is below 15. thank you once again for help. but i can't vote for the answer – saivishal vangala Feb 13 '20 at 13:21
  • https://stackoverflow.com/questions/60208754/error-while-setting-filebeat-up-and-make-it-connect-to-elastic-search – saivishal vangala Feb 13 '20 at 13:22
  • this is the link of my new question. please go through once and check is u can solve my error. thankyou – saivishal vangala Feb 13 '20 at 13:23
17

Had the same Problem , but it in fact in the log was shown that the vm.max_map_count was set to small by default. This caused the cascading issue with the message in the end.

After using ( Linux ) my problem was solved

sysctl -w vm.max_map_count=262144

On Windows with docker desktop and WSL2 access Docker desktop :

 wsl -d docker-desktop

and then use the command above

sysctl -w vm.max_map_count=262144
Dominik Sand
  • 462
  • 4
  • 7
9

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.

Amit
  • 30,756
  • 6
  • 57
  • 88