elasticsearch 6 在 centos 6 上的安裝問題


ERROR: bootstrap checks failed
max file descriptors [4096] for elasticsearch process likely too low, 
increase to at least [65536]
max number of threads [1024] for user [lishang] likely too low,
 increase to at least [2048]
max virtual memory areas vm.max_map_count [65530] likely too low, 
increase to at least [262144]

解決:切換到root用戶,編輯limits.conf 添加類似如下內容

vi /etc/security/limits.conf 

添加如下內容:

* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096

對於第二條錯誤同意需要切換到root用戶,進入limits.d目錄下修改配置文件。

vi /etc/security/limits.d/90-nproc.conf 

修改如下內容:

* soft nproc 1024
#修改為
* soft nproc 2048

第三條錯誤需要切換到root用戶修改配置sysctl.conf

vi /etc/sysctl.conf 

添加下面配置:

vm.max_map_count=655360

並執行命令:

sysctl -p

然后,重新啟動elasticsearch,即可啟動成功。

啟動問題
**1、Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000085330000, 2060255232, 0) failed; error='Cannot allocate memory' (errno=12)**

由於elasticsearch5.0默認分配jvm空間大小為2g,修改jvm空間分配

# vim config/jvm.options  
-Xms2g  
-Xmx2g  
修改為  
-Xms512m  
-Xmx512m  

2、max number of threads [1024] for user [elasticsearch] is too low, increase to at least [2048]修改 /etc/security/limits.d/90-nproc.conf

*          soft    nproc     1024
*          soft    nproc     2048

3、max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
修改/etc/sysctl.conf配置文件,

cat /etc/sysctl.conf | grep vm.max_map_countvm.max_map_count=262144

如果不存在則添加

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

4、max file descriptors [65535] for elasticsearch process likely too low, increase to at least [65536]
需要執行下面的命令

ulimit -n 65536


作者:未不明不知不覺
鏈接:http://www.jianshu.com/p/4c6f9361565b
來源:簡書
著作權歸作者所有。商業轉載請聯系作者獲得授權,非商業轉載請注明出處。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM