当前位置:   article > 正文

NoNodeAvailableException: None of the configured nodes are available(elasticsearch报错)_nonodeavailableexception[none of the configured no

nonodeavailableexception[none of the configured nodes are available

出现这种错误的原因是有多种的,可能是你的elasticsearch没有启动成功,又或者是network.host没有对外开发,这里我说下我遇到的问题.

elasticsearch的配置文件配置在config目录下的elasticsearch.yml文件中

elasticsearch默认的端口为9200和9300

9200是对外开发的端口

9300是集群节点通讯的端口

当我们在java程序中集成elasticsearch时候,在配置文件中必须配置elasticsearch

  1. # elasticsearch
  2. spring.data.elasticsearch.cluster-nodes=IP:端口
  3. spring.data.elasticsearch.cluster-name=hysn-application

需要注意的是spring.data.elasticsearch.cluster-nodes=IP:端口属性中配置的是内部节点的tcp端口而不是http对外端口,否则会出现该错误

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/457670
推荐阅读
相关标签
  

闽ICP备14008679号