Reputation: 8371
I have a simple docker setup in which, I pulled Elastic search from Docker Hub using the following command:
docker pull elasticsearch:7.6.2
Version code is mentioned since it's not working for the latest tag.
Then I created an ElasticSearch container using command:
docker container run -d -p 9200:9200 --name elasticsearch elasticsearch:7.6.2
After entering the above command the container is created and running but it ran for a couple of seconds and then it crashed with the error message: Native controller process has stopped - no new native processes can be started.
Below is the complete Error JSON
{"type": "server", "timestamp": "2020-04-07T19:28:05,721Z", "level": "INFO", "component": "o.e.x.m.p.NativeController", "cluster.name": "docker-cluster", "node.name": "c62b88f8807c", "message": "Native controller process has stopped - no new native processes can be started" }
I googled and tried many links, I tried recreating the container, redownloading the image of a lower version, I even tried increasing memory in Docker > Settings > Resources > Advanced but still it did not work for me.
I have tried all options on following link: https://github.com/elastic/elasticsearch/issues/25067
Please help, thanks in advance!!!
Upvotes: 4
Views: 7715
Reputation: 32376
As you are running elasticsearch docker in development mode, you need to use discovery.type=single-node
to avoid the production boot-strap checks, which is causing your docker to exit.
As mentioned in the comment adding discovery.type=single-node
solved the issue and below is the complete command.
docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" --name elasticsearch elasticsearch:7.6.2
Upvotes: 12