永久增加 podman 机器虚拟机中的 vm.max_map_count
我正在尝试使用 podman 在我的 Mac m1 笔记本电脑上运行 Elasticsearch 映像。它将失败并显示以下消息:
错误:[1] 引导检查失败。在启动 Elasticsearch 之前,您必须解决以下 [1] 行中描述的要点。 [1] 的引导检查失败 [1]:最大虚拟内存区域 vm.max_map_count [65530] 太低,至少增加到 [262144]
我可以通过使用 ssh 进入 podman 机器 vm 并设置 vm 来临时解决这个问题。 max_map_count 与
sudo sysctl -w vm.max_map_count=262144
但是,如果我停止并重新启动 podman 机器 vm,该设置将恢复为默认 65530。
有没有办法永久设置 podman 机器 vm 的 vm.max_map_count?
I am trying to run the Elasticsearch image on my Mac m1 laptop using podman. It will fail with the message:
ERROR: [1] bootstrap checks failed. You must address the points described in the following [1] lines before starting Elasticsearch.
bootstrap check failure [1] of [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
I can solve this temporarily by using ssh to enter the podman machine vm and setting vm.max_map_count with
sudo sysctl -w vm.max_map_count=262144
However, if I stop and restart the podman machine vm, the setting is back to the default 65530.
Is there a way to permanently set vm.max_map_count for the podman machine vm?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我最近也遇到过这个。您可能已经自己解决了这个问题,但如果没有的话。
要在启动时修改内核参数,只需添加一个条目,执行您的 sysctl 配置之一,它将在重新启动时应用。
I came across this recently too. You might have already sorted it out on your own, but if not.
To modify kernel parameters at boot just add an entry do one of your sysctl configs and it will be applied on reboot.