Windows 上 docker 的 vm.max_map_count 问题 [英] vm.max_map_count problem for docker at windows
问题描述
我正在尝试在我的 windows10 上运行 ELK docker 图像,如下所示.
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
我遇到以下错误,我可以在 docker run 命令行中设置 vm.max_map_count 吗?
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!
推荐答案
我在运行 elastic/elastic 方面有类似的经验,所以这可能会有所帮助.
I've had similar experience with running elastic/elastic, so this might help.
当您在 WSL2 中运行它时,您可能想要登录到您的 WSL VM:wsl -d docker-desktop
(其中 docker-desktop 是虚拟机的名称,您可以使用 wsl --list
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
进入您的 docker-desktop 后,执行以下操作:
Once in your docker-desktop, do the following:
echo "vm.max_map_count = 262144">/etc/sysctl.d/999-docker-desktop-conf
其次是:sysctl -w vm.max_map_count=262144
然后您可以通过键入 exit
退出 docker-host.
You can then exit the docker-host by typing exit
.
这篇关于Windows 上 docker 的 vm.max_map_count 问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!