在安裝elasticsearch的時候,很多人安裝完成啟動之后可能都會報bootstrap checks failed的錯誤,其中可能有如下幾種類型:
[1]: max file descriptors [1024] 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]
[3]: system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
[4]: max number of threads [1024] for user [lish] likely too low, increase to at least [2048]
針對第一個問題:max file descriptors [1024] for elasticsearch process is too low, increase to at least [4029]
編輯 /etc/security/limits.conf,追加以下內容;
* soft nofile 65536 #具體的值可以按照錯誤提示中方括號"[ ]"中,提示的值修改
* hard nofile 65536
注:如果編輯重啟啟動之后還不能消除這個錯誤,則重登陸用戶。
針對第二個問題:max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
編輯 /etc/sysctl.conf,追加以下內容:
vm.max_map_count=262144
保存后,執行:
sysctl -p
重新啟動,成功。
針對第三個問題:system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
出現錯誤的原因:是因為centos6.x操作系統不支持SecComp,而elasticsearch 5.5.2默認bootstrap.system_call_filter為true進行檢測,所以導致檢測失敗,失敗后直接導致ES不能啟動。
在elasticsearch.yml中添加配置項:bootstrap.system_call_filter為false:
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
針對第四個問題:max number of threads [1024] for user [wh] likely too low, increase to at least [2048]
vi /etc/security/limits.d/90-nproc.conf
修改如下內容:
* soft nproc 1024
#修改為
* soft nproc 2048
注:以上問題如果編輯重啟啟動之后還不能消除這個錯誤,則重登陸用戶。