天天看點

ElasticSearch啟動失敗常見問題

ElasticSearch啟動失敗常見問題

1. 報錯【1】

the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured

解決辦法

放開elasticsearch.yml中的cluster.initial_master_nodes注釋,後面參數配置用到的節點名稱

cluster.initial_master_nodes: [“node-1”]

2.報錯【2】

java.lang.UnsupportedOperationException: seccomp unavailable: CONFIG_SECCOMP not compiled into kernel, CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER are needed

錯誤原因:

Centos6不支援SecComp,而ES預設bootstrap.system_call_filter為true進行檢測,是以導緻檢測失敗,失敗後直接導緻ES不能啟動。

解決辦法:

在所有節點的elasticsearch.yml配置檔案中加入:

bootstrap.memory_lock: false
bootstrap.system_call_filter: false
           

3.報錯【3】

max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]

每個程序最大同時打開檔案數太小,可通過下面2個指令檢視目前數量

ulimit -Hn
ulimit -Sn
           

修改/etc/security/limits.conf檔案,增加配置,使用者退出後重新登入生效

* soft nofile 65536
* hard nofile 65536
           

4.報錯【4】

max number of threads [1024] for user [elasticsearch] is too low, increase to at least [4096]

最大線程個數太低,可通過下面2個指令檢視目前數量

ulimit -Hu
ulimit -Su
           

修改配置檔案/etc/security/limits.conf,增加配置

* soft nproc 4096
* hard nproc 4096
           

修改配置檔案/etc/security/limits.d/90-nproc.conf,修改配置,使用者退出後重新登入生效

*          soft    nproc    4096
root       soft    nproc     unlimited
           

5.報錯【5】

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

修改/etc/sysctl.conf檔案,增加配置

vm.max_map_count=655360
           

執行以下指令生效

sysctl -p
           

6.報錯【6】

Exception in thread “main” java.nio.file.AccessDeniedException: /opt/elasticsearch/elasticsearch-7.6.2/config/jvm.options

elasticsearch使用者沒有使用該檔案夾的權限,執行指令

chown elasticsearch.elasticsearch /opt/elasticsearch -R
           

大家可根據自己定義的使用者和路徑更改指令

繼續閱讀