Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ElasticSearch in Windows docker image vm max map count

Tags:

I am new to Docker and Elasticsearch. I am using a Windows 7 machine. I am using docker-compose up to bring up the docker container. My yml file has

elasticsearch:   image: elasticsearch:5.1.1   environment:     ES_JAVA_OPTS: "-Xms1g -Xmx1g" 

along with other linked images.
I am using docker to bring up the elasticsearch image and when I do so I get the following error

[36melasticsearch_1   |←[0m ERROR: bootstrap checks failed [36melasticsearch_1   |←[0m max virtual memory areas vm.max_map_count [65530]  is too low, increase to at least [262144] [36melasticsearch_1   |←[0m [2017-02-08T11:06:51,752][INFO ][o.e.n.Node 

I googled for a solution and everywhere they suggest to use sudo sysctl vm.max_map_count=262144, but in Windows sysctl is not available. No clear steps are given for Windows.

Some other Docker images are up and running on my machine so Docker is working.

Can someone give any clues to solve this issue?

like image 343
Anantha Krishnan Avatar asked Feb 08 '17 11:02

Anantha Krishnan


People also ask

What is VM max map count?

The maximum map count check checks that the kernel allows a process to have at least 262,144 memory-mapped areas and is enforced on Linux only. To pass the maximum map count check, you must configure vm. max_map_count via sysctl to be at least 262144 .

Where is Sysctl conf in Windows?

/etc/sysctl. conf.

What is Elasticsearch docker?

Elasticsearch is a powerful open source search and analytics engine that makes data easy to explore. docker pull elasticsearch. OverviewTags.


1 Answers

I have been stuck for months on this problem, the solution is launch the following commands on cmd.exe (try Powershell or Bash if cmd doesn't work), as stated in the official Elasticsearch documentation:

1) wsl -d docker-desktop 2) sysctl -w vm.max_map_count=262144 

And you are ready to start Elasticsearch!

like image 70
Paolo De Dominicis Avatar answered Sep 24 '22 00:09

Paolo De Dominicis