How to increase vm.max_map_count?

两盒软妹~` 提交于 2021-02-05 20:21:21

问题


I'm trying to run Elastic search in an Ubuntu EC2 machine (t2.medium).

But I'm getting the message:

max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

How can I increase the vm.max_map_count?


回答1:


To make it persistent, you can add this line:

vm.max_map_count=262144

in your /etc/sysctl.conf and run

$ sudo sysctl -p

to reload configuration with new value




回答2:


I use

# sysctl -w vm.max_map_count=262144 

And for the persistence configuration

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

Att.




回答3:


sysctl -w vm.max_map_count=262144



回答4:


When:

permission denied on key 'vm.max_map_count'

sudo sysctl -w vm.max_map_count=262144



回答5:


If you are using ubuntu VM, then navigate to etc folder.

  1. Run vim sysctl.conf

  2. Add vm.max_map_count=262144 to the end of the file and save

  3. Finally run sudo sysctl -w vm.max_map_count=262144 this command you will see vm.max_map_count=262144




回答6:


Note that

From version 207 and 21x, systemd only applies settings from /etc/sysctl.d/*.conf and /usr/lib/sysctl.d/*.conf. If you had customized /etc/sysctl.conf, you need to rename it as /etc/sysctl.d/99-sysctl.conf. If you had e.g. /etc/sysctl.d/foo, you need to rename it to /etc/sysctl.d/foo.conf.

See https://wiki.archlinux.org/index.php/sysctl#Configuration

So add vm.max_map_count=262144 in /etc/sysctl.d/99-sysctl.conf and then run

sudo sysctl --system




回答7:


Following command as worked fine on Fedora 28 (Linux 4.19 Kernel)

sudo echo "vm.max_map_count=262144" >> /etc/sysctl.d/elasticsearchSpecifications.conf && sudo sysctl --system



来源:https://stackoverflow.com/questions/42889241/how-to-increase-vm-max-map-count

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!