本文主要是介绍elasticsearch无法访问9200端口,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
近期部署elasticsearch后,启动时发现一直报如下错误:
curl: (7) Failed connect to localhost:9200; Connection refused
部署的版本为elasticsearch-7.13.2,排查原因是因为开启了ssl认证。
解决方法:
在/opt/software/elasticsearch-7.13.2/config下修改elasticsearch.yml配置,添加如下内容:
xpack.security.http.ssl.enabled: false
日志报错2如下:
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: failed to obtain node locks, tried [[/data/es/data]] with lock id [0]; maybe these locations are not writable or multiple nodes were started without increasing [node.max_local_storage_nodes] (was [1])?
解决方法:
修改配置文件elasticsearch.yml,并最后添加如下内容:vim ./config/elasticsearch.yml
node.max_local_storage_nodes: 2
这篇关于elasticsearch无法访问9200端口的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!