I am trying to run ELK docker images on my windows10 as below.
C:\WINDOWS\system32> docker run -p 5601:5601 -p 9200:9200 -p 9300:9300 -p 5044:5044 -p 9600:9600 -p 9700:9700 -it --memory="3g" --name elk sebp/elk
I got below error, could i set vm.max_map_count at docker run command line?
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
Any suggestion or hints are more than welcome!
This can be done via WSL's support of a .wslconfig file (stored in your Windows %userprofile% folder), which can apply and persist such setting across restarts, for example:
[wsl2]
kernelCommandLine = sysctl.vm.max_map_count=262144
(Note that's NOT a space after sysctl, but a period, which is necessary for it to work, from my testing.)
After saving the file, restart wsl with wsl --shutdown. Before reopening your WSL, make sure the vm is shutdown, using wsl -l -v, as it can take several seconds sometimes.
For more on this file, its many available settings, and even that need to wait for the shutdown, see the docs.
I've had similar experience with running elastic/elastic, so this might help.
When you're running it in WSL2, you might want to log in to your WSL VM:
wsl -d docker-desktop (Where docker-desktop is the name of the vm, you can check for them with wsl --list
Once in your docker-desktop, do the following:
echo "vm.max_map_count = 262144"> /etc/sysctl.d/999-docker-desktop-conf
followed by:
sysctl -w vm.max_map_count=262144
You can then exit the docker-host by typing exit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With