centos上安装elasticsearch 5.5.1 遇到的各种坑

时间:2022-04-22
本文章向大家介绍centos上安装elasticsearch 5.5.1 遇到的各种坑,主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

mac玩得好好滴,一次性启动成功,结果在centos上安装时,遇坑无数,记录一下:

一、只能localhost访问的问题 修改 confelasticsearch.yml

network.host: 0.0.0.0
http.port: 9200
discovery.zen.ping.unicast.hosts: ["0.0.0.0"]

二、各种启动 ... too low 的妖娥子

比如: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536] max number of threads [1024] for user [lishang] likely too low, increase to at least [2048] max number of threads [1024] for user [elasticsearch] is too low, increase to at least [2048]

2.1 修改/etc/security/limits.conf

# /etc/security/limits.conf
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096

2.2 修改 /etc/security/limits.d/90-nproc.conf

* soft nproc 2048
root soft nproc unlimited
deploy soft nproc unlimited

2.3 修改/etc/sysctl.conf

追加(如果已存在,则直接修改)

vm.max_map_count=262144

然后执行sysctl -p

三、启动中的 bootstrap checks failed

仍然修改 confelasticsearch.yml

bootstrap.memory_lock: false
bootstrap.system_call_filter: false