ElasticSearch 5 安裝部署常見錯(cuò)誤或問題
問題1:
uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root
問題原因:不能使用root用戶啟動(dòng)
解決方案:改用別的用戶
問題2:
unable to install syscall filter:
java.lang.UnsupportedOperationException: seccomp unavailable: requires kernel 3.5+ with CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER compiled in
at org.elasticsearch.bootstrap.SystemCallFilter.linuxImpl(SystemCallFilter.java:350) ~[elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.bootstrap.SystemCallFilter.init(SystemCallFilter.java:638) ~[elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.bootstrap.JNANatives.tryInstallSystemCallFilter(JNANatives.java:215) [elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.bootstrap.Natives.tryInstallSystemCallFilter(Natives.java:99) [elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:111) [elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:204) [elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:360) [elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:123) [elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:114) [elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:67) [elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:122) [elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.cli.Command.main(Command.java:88) [elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) [elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) [elasticsearch-5.4.0.jar:5.4.0]
原因:報(bào)了一大串錯(cuò)誤空入,大家不必驚慌,其實(shí)只是一個(gè)警告珍特,主要是因?yàn)槟鉒inux版本過低造成的最欠。
解決方案:
1怎披、重新安裝新版本的Linux系統(tǒng)
2、警告不影響使用,可以忽略
問題3:
ERROR: bootstrap checks failed
memory locking requested for elasticsearch process but memory is not locked
原因:鎖定內(nèi)存失敗
解決方案:
切換到root用戶疏尿,編輯limits.conf配置文件, 添加類似如下內(nèi)容:
sudo vim /etc/security/limits.conf
添加如下內(nèi)容:
- soft memlock unlimited
- hard memlock unlimited
備注:* 代表Linux所有用戶名稱
保存易桃、退出褥琐、重新登錄才可生效
臨時(shí)取消限制
ulimit -l unlimited
問題4:
ERROR: bootstrap checks failed
max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
原因:無(wú)法創(chuàng)建本地文件問題,用戶最大可創(chuàng)建文件數(shù)太小
解決方案:
切換到root用戶,編輯limits.conf配置文件晤郑, 添加類似如下內(nèi)容:
sudo vim /etc/security/limits.conf
添加如下內(nèi)容:
- soft nofile 65536
- hard nofile 131072
備注:* 代表Linux所有用戶名稱
保存敌呈、退出贸宏、重新登錄才可生效
問題5:
max number of threads [1024] for user [es] is too low, increase to at least [2048]
原因:無(wú)法創(chuàng)建本地線程問題,用戶最大可創(chuàng)建線程數(shù)太小
解決方案:切換到root用戶,進(jìn)入limits.d目錄下磕洪,修改90-nproc.conf 配置文件吭练。
sudo vim /etc/security/limits.d/90-nproc.conf
找到如下內(nèi)容:
- soft nproc 1024
修改為
- soft nproc 2048
問題6:
max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
原因:最大虛擬內(nèi)存太小
解決方案:切換到root用戶下,修改配置文件sysctl.conf
sudo vim /etc/sysctl.conf
添加下面配置:
vm.max_map_count=655360
并執(zhí)行命令:
sysctl -p
問題7:
system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
問題原因:因?yàn)镃entos6不支持SecComp
SecComp是Linux kernel (自從2.6.23版本之后)所支持的一種簡(jiǎn)潔的sandboxing機(jī)制析显。它能使一個(gè)進(jìn)程進(jìn)入到一種“安全”運(yùn)行模式鲫咽,該模式下的進(jìn)程只能調(diào)用4種系統(tǒng)調(diào)用(system calls),即read(), write(), exit()和sigreturn()谷异,否則進(jìn)程便會(huì)被終止分尸。
而ES5.2以后的版本默認(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
System call filter settingedit
Elasticsearch has attempted to install a system call filter since version 2.1.0. These are enabled by default and could be disabled via bootstrap.seccomp. The naming of this setting is poor since seccomp is specific to Linux but Elasticsearch attempts to install a system call filter on various operating systems. Starting in Elasticsearch 5.2.0, this setting has been renamed to bootstrap.system_call_filter. The previous setting is still support but will be removed in Elasticsearch 6.0.0.
解決方法:在elasticsearch.yml中配置bootstrap.system_call_filter為false,注意要在Memory下面:
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
問題8:
ElasticSearch啟動(dòng)找不到主機(jī)或路由
原因:ElasticSearch 單播配置有問題
解決方案:
檢查ElasticSearch中的配置文件
vim config/elasticsearch.yml
找到如下配置:
discovery.zen.ping.unicast.hosts:["192.168..:9300","192.168..:9300"]
一般情況下荞下,是這里配置有問題伶选,注意書寫格式
問題9:
org.elasticsearch.transport.RemoteTransportException: Failed to deserialize exception response from stream
原因:ElasticSearch節(jié)點(diǎn)之間的jdk版本不一致
解決方案:ElasticSearch集群統(tǒng)一jdk環(huán)境ls
問題10:
Unsupported major.minor version 52.0
原因:jdk版本問題太低
解決方案:更換jdk版本,ElasticSearch5.0.0支持jdk1.8.0
問題11:
bin/elasticsearch-plugin install license
ERROR: Unknown plugin license
原因:ElasticSearch5.0.0以后插件命令已經(jīng)改變
解決方案:使用最新命令安裝所有插件
bin/elasticsearch-plugin install x-pack