- 问题一
max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
配置 /etc/sysctl.conf
1 | $ vi /etc/sysctl.conf |
生效
1 | $ sysctl -p |
验证1
$ sysctl -a|grep vm.max_map_count
- 问题二
max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
max number of threads [1024] for user [XXX] is too low,increase to least [2048]
1、修改 nofile
时候,需要在 /etc/sysctl.conf
和 /etc/security/limits.conf
配置,其中 /etc/sysctl.conf
中配置的值需要比 /etc/security/limits.conf
的值大 。
配置 /etc/sysctl.conf
1 | $ vi /etc/sysctl.conf |
生效1
$ sysctl -p
配置 /etc/security/limits.conf
1
2$ vi /etc/security/limits.conf
elasticsearch - nofile 65536
或者1
* - nofile 65536
2、修改 nofile
和 nproc
CentOS 7
的 nproc
的修改在 /etc/security/limits.d/20-nproc.conf
,为了方便在 /etc/security/limits.conf
和 /etc/security/limits.d/20-nproc.conf
文件里面同时都添加了 。
配置 /etc/security/limits.conf
1 | $ vi /etc/security/limits.conf |
配置 /etc/security/limits.d/20-nproc.conf
1
2
3$ vi /etc/security/limits.d/20-nproc.conf
* - nofile 65536
* - nproc 65536
重启系统,验证1
$ ulimit -Hn
总结:1
2
3
4
5
6
7
8
9
10
11$ vi /etc/sysctl.conf
vm.max_map_count=262144
fs.file-max=512000
$ vi /etc/security/limits.conf
elasticsearch - nofile 65536
* - nproc 65536
$ vi /etc/security/limits.d/20-nproc.conf
* - nofile 65536
* - nproc 65536