ERROR: [4] bootstrap checks failed
(1) max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
原因:每个进程最大同时打开文件数太小
查看当前每个进程最大同时打开文件数
ulimit -Sn
ulimit -Hn
修改配置
vi /etc/security/limits.conf
添加如下内容
* soft nofile 65536
* hard nofile 131072
用户退出后重新登录生效
(2) memory locking requested for elasticsearch process but memory is not locked
原因:锁定内存失败
vim /etc/security/limits.conf
添加如下内容
* soft memlock unlimited
* hard memlock unlimited
(3) max number of threads [3795] for user [elastic] is too low, increase to at least [4096]
原因:最大线程个数太低
vim /etc/security/limits.conf
添加如下内容
* soft nproc 2048
* hard nproc 4096
(4) max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]
原因:操作系统的vm.max_map_count参数设置太小
vim /etc/sysctl.conf
添加
vm.max_map_count=262144
执行此命令使上面的配置生效
sysctl -p
或者直接通过命令设置
sysctl -w vm.max_map_count=262144
sysctl -a | grep "vm.max_map_count" //查看是否修改成功