一、报错如下:
ERROR: [2] bootstrap checks failed [1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536] [2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
二、解决步骤如下:
1、问题1 [1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]的解决方式:
(请切换到root用户 然后强制修改文件)修改/etc/security/limits.conf文件,添加或修改如下行:
* hard nofile 65536
* soft nofile 65536
2、问题2 [2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]的解决方式:
第一种方式:
切换到root用户, 执行$ sudo sysctl -w vm.max_map_count=2621441命令
第二种方式:
#切换到root用户,
su root
#编辑 /etc/sysctl.conf
vi /etc/sysctl.conf
#添加如下参数
vm.max_map_count=2621441
执行 sudo sysctl -p /etc/sysctl.conf 命令,设置 永久改变