1. 程式人生 > >org.elasticsearch.bootstrap.StartupException: java.lang.IllegalArgumentExceptio

org.elasticsearch.bootstrap.StartupException: java.lang.IllegalArgumentExceptio

這是我轉載的一片文章,解決了我的問題,所以記錄一下。

話不多說,見正文吧!

elasticsearch安裝踩過的那些坑:

坑1: 

[***]failed to send join request to master 

原因:你複製了某個節點的elasticsearch資料夾,但是這裡麵包含了該節點的data檔案
解決:刪除elasticsearch資料夾下data目錄的內容

坑2:

ERROR: bootstrap checks failed
memory locking requested for elasticsearch process but memory is not locked

原因:鎖定記憶體失敗
解決:vim /etc/security/limits.conf 新增下面兩行

  • soft memlock unlimited
  • hard memlock unlimited
    tips:* 代表的是linux內所有的使用者

坑3:
ERROR: bootstrap checks failed
max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

原因:無法建立本地檔案,使用者最大可建立檔案數不夠
解決:vim /etc/security/limits.conf

  •            hard    nofile          65536
    
  •            soft    nofile          65536
    
  •            soft    nproc           65536
    
  •            hard    nproc           65536
    

    坑4:
    max number of threads [1024] for user [es] is too low, increase to at least [2048]

原因:無法建立本地執行緒問題,使用者最大可建立執行緒數太小
解決:vim /etc/security/limits.d/90-nproc.conf

  • soft nproc 2048(這邊原本是1024)

    坑5:
    max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

原因:最大虛擬記憶體太小
解決:vim /etc/sysctl.conf 新增下面這一行
vm.max_map_count=262144
並執行命令:sysctl -p

坑6:
system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk

原因:Centos6不支援SecComp
解決:vim elasticsearch.yml 切記在記憶體鎖的下面加
bootstrap.memory_lock: false
bootstrap.system_call_filter: false

  坑7:
    uncaught exception in thread [main]
    org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root

原因:elasticsearch不能使用root使用者啟動
解決:建立新使用者(useradd elasticsearch)並 chown -R elasticsearch:elasticsearch elasticsearch-5.2.2 [更改elasticsearch資料夾的使用者以及所屬組]

坑8:
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]

原因:linux核心版本太低
解決:涼涼,換個新版本的linux系統吧。

坑9:
Unsupported major.minor version 52.0

原因:java版本太低
解決:更換jdk版本,ElasticSearch5.0.0支援jdk1.8.0以上

坑10:
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalArgumentException: Property [elasticsearch.version] is missing for plugin [head]
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:125) ~[elasticsearch-5.2.2.jar:5.2.2]
        at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:112) ~[elasticsearch-5.2.2.jar:5.2.2]
        at org.elasticsearch.cli.SettingCommand.execute(SettingCommand.java:54) ~[elasticsearch-5.2.2.jar:5.2.2]
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:122) ~[elasticsearch-5.2.2.jar:5.2.2]
        at org.elasticsearch.cli.Command.main(Command.java:88) ~[elasticsearch-5.2.2.jar:5.2.2]
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:89) ~[elasticsearch-5.2.2.jar:5.2.2]
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:82) ~[elasticsearch-5.2.2.jar:5.2.2]
Caused by: java.lang.IllegalArgumentException: Property [elasticsearch.version] is missing for plugin [head]
        at org.elasticsearch.plugins.PluginInfo.readFromProperties(PluginInfo.java:104) ~[elasticsearch-5.2.2.jar:5.2.2]
        at org.elasticsearch.plugins.PluginsService.getPluginBundles(PluginsService.java:292) ~[elasticsearch-5.2.2.jar:5.2.2]
        at org.elasticsearch.plugins.PluginsService.<init>(PluginsService.java:131) ~[elasticsearch-5.2.2.jar:5.2.2]
        at org.elasticsearch.node.Node.<init>(Node.java:297) ~[elasticsearch-5.2.2.jar:5.2.2]
        at org.elasticsearch.node.Node.<init>(Node.java:232) ~[elasticsearch-5.2.2.jar:5.2.2]
        at org.elasticsearch.bootstrap.Bootstrap$6.<init>(Bootstrap.java:241) ~[elasticsearch-5.2.2.jar:5.2.2]
        at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:241) ~[elasticsearch-5.2.2.jar:5.2.2]
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-5.2.2.jar:5.2.2]
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) ~[elasticsearch-5.2.2.jar:5.2.2]
        ... 6 more

原因:elasticsearch新版本是不允許安裝外掛在檔案目錄plugins下面的
解決:將plugins下面的外掛目錄放到其他目錄即可

作者:chenyn911
來源:CSDN
原文:https://blog.csdn.net/u013753225/article/details/78753399
版權宣告:本文為博主轉載,想看原文請點選原文連結!