Search code examples
macoselasticsearchcontainerspodman

Increase vm.max_map_count permanently in podman machine vm


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?


Solution

  • 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.

    # echo "vm.max_map_count = 262144" >> /etc/sysctl.d/99-sysctl.conf