CentOS7單節點啓動Elasticsearch7.4報錯

elasticsearch7.4.0啓動報錯:

ERROR: [3] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[3]: 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

解決操作

以下操作需切換到root用戶下
$ sudo -s

問題[1]

查看軟硬限制命令
# ulimit -Su
# ulimit -Hu
在文件 /etc/security/limits.conf 末尾添加以下內容(* 表示所有用戶)

* soft nofile 65536
* hard nofile 131072

如果還報錯max number of threads [3818] for user [es] is too low, increase to at least [4096]
則需要在 /etc/security/limits.conf 末尾 追加

* soft nproc 2048
* hard nproc 4096

以上配置需要用戶重新登陸後生效

問題[2]

臨時修改解決辦法(重啓系統失效):
# sysctl -w vm.max_map_count=262144
查看結果:
# sysctl -a|grep vm.max_map_count
顯示:vm.max_map_count = 262144

永久修改解決辦法:
在 /etc/sysctl.conf文件最後添加一行

vm.max_map_count=262144

生效查看:
# sysctl -p

問題[3]

修改 config/elasticsearch.yml 保留一個節點
cluster.initial_master_nodes: ["node-1"]

其它問題

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

在 config/elasticsearch.yml中修改或添加配置項:
bootstrap.memory_lock: false
bootstrap.system_call_filter: false

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章