4

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!!!

Akshay Khale
  • 8,151
  • 8
  • 50
  • 58
  • 1
    Can you try https://stackoverflow.com/a/60426167/4039431 and let me know if it doesn't work – Amit Apr 08 '20 at 05:11
  • 2
    It worked `docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" --name elasticsearch elasticsearch:7.6.2` worked for me, please post it as the answer so that I can accept and close it @OpsterElasticsearchNinja – Akshay Khale Apr 08 '20 at 05:22
  • 1
    Glad it worked :), posted answer as well. – Amit Apr 08 '20 at 06:54

1 Answers1

11

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
Amit
  • 30,756
  • 6
  • 57
  • 88
  • Ran this: docker run --name es01 --net elastic -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -it docker.elastic.co/elasticsearch/elasticsearch:8.3.1 ... did not work – Vinit Khandelwal Jul 04 '22 at 01:42