Elasticsearch安装启动,Elasticsearch访问 IP:9200等问题解决

几个重要问题

1、本地 curl localhost:9200 成功访问

其它机器通过ip无法访问

解决办法:

config/elasticsearch.yml文件中, 
添加 network.host: 0.0.0.0 表示所有用户可访问 

(最开始以为是防火墙的问题

iptables -A INPUT -p tcp --dport 9200 -j ACCEPT
iptables -A OUTPUT -p tcp --sport 9200 -j ACCEPT

执行之后,仍然不行,所以想到可能是 es的端口号问题。有点类似mysql,其他host访问,可能提示权限不够

2、bootstrap启动 报错,关键字 secComp

secComp,而elasticsearch5.2.0以上的版本默认bootstrap。system_call_filter为true进行检测,所以导致检测失败,失败后会导致es不能启动。 
所以,继续在该文件添加 

bootstrap.memory_lock: false 
bootstrap.system_call_filter: false 
 

3、ERROR: [2] bootstrap checks failed 
[1]: max number of threads [1024] for user [user] is too low, increase to at least [4096] 
[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144] 
(我只遇到了第1个问题)

到 /etc/security/limits.d/90-nproc.conf文件中修改最大线程数

*  soft nproc 1024
# 将上面的修改为:
*  soft nproc 4096

我的Linux机器,重启(执行reboot命令)之后,才生效。

有的网友说,不重启直接生效了,可能和机器有关。

 

 

4、bootstrap checks failed

[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: ["node-1", "node-2"] 修改为 cluster.initial_master_nodes: ["node-1"],记得保存。

 

核心总结:elasticsearch.yml,需要各种配置。

不像Redis、Mysql等其它中间件,默认配置就能跑起来。

 

参考资料:

https://blog.csdn.net/qq_32331997/article/details/79775485

elasticsearch学习之路---Linux 下安装并启动elasticsearch

 

Elasticsearch的初次搭建

https://www.jianshu.com/p/169acce2ce25

Linux下iptables 禁止端口和开放端口

https://blog.csdn.net/ll641058431/article/details/81542116

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值