1.問(wèn)題描述: 我明明是安裝java8 elasticsearch啟動(dòng)時(shí)還是報(bào) java版本錯(cuò)誤.
執(zhí)行elasticsearch的時(shí)候報(bào)錯(cuò):錯(cuò)誤: 找不到或無(wú)法加載主類 org.elasticsearch.tools.JavaVersionChecker
Elasticsearch requires at least Java 8 but your Java version from /usr/java/jdk1.8.0_73/bin/java does not meet this requiremen
解決方案 問(wèn)題所在
創(chuàng)建一個(gè)文件夾 文件夾得名稱是為es 將elasticsearch.6.02 拷貝到es里面. 創(chuàng)建es用戶. 同時(shí)將es文件夾設(shè)置用戶es權(quán)限. chown -R /es es 重啟啟動(dòng)即可解決問(wèn)題.
2問(wèn)題描述: 虛擬內(nèi)存不足 . 嘗試擴(kuò)大虛擬內(nèi)存大小 但沒(méi)有解決.
** VM warning: INFO: os::commit_memory(0x0000000085330000, 2060255232, 0) failed; error='Cannot allocate memory' (errno=12)**
解決方案:
由于elasticsearch5.0默認(rèn)分配jvm空間大小為2g,修改jvm空間分配
# vim config/jvm.options
-Xms2g --》修改為512m
-Xmx2g --》修改為512m
3,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]
解決方案
第一個(gè)
解決:切換到root用戶,編輯limits.conf 添加類似如下內(nèi)容
vi /etc/security/limits.conf
添加如下內(nèi)容:
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096
對(duì)于第二條錯(cuò)誤同意需要切換到root用戶废酷,進(jìn)入limits.d目錄下修改配置文件站叼。
vi /etc/security/limits.d/90-nproc.conf
修改如下內(nèi)容:
* soft nproc 1024
#修改為
* soft nproc 2048
第三條錯(cuò)誤需要切換到root用戶修改配置sysctl.conf
vi /etc/sysctl.conf
添加下面配置:
vm.max_map_count=655360
并執(zhí)行命令:
sysctl -p
然后臊岸,重新啟動(dòng)elasticsearch焦除,即可啟動(dòng)成功。
4英古、max file descriptors [65535] for elasticsearch process likely too low, increase to at least [65536]
需要執(zhí)行下面的命令
ulimit -n 65536
5淀衣、啟動(dòng)異常:ERROR: bootstrap checks failed
問(wèn)題描述:
system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
問(wèn)題原因:因?yàn)镃entos6不支持SecComp,而ES默認(rèn)bootstrap.system_call_filter為true進(jìn)行檢測(cè)召调,所以導(dǎo)致檢測(cè)失敗膨桥,失敗后直接導(dǎo)致ES不能啟動(dòng)。詳見 :https://github.com/elastic/elasticsearch/issues/22899
解決方法:在elasticsearch.yml中配置bootstrap.system_call_filter為false唠叛,注意要在Memory下面:
bootstrap.memory_lock: false
bootstrap.system_call_filter: false