当前位置:   article > 正文

NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{QVFHsEVaRHiYIb

nonodeavailableexception[none of the configured nodes are available: [{#tran

使用java api和elastic search进行交互时,进行到如下代码编写:

  1. elasticsearch:
  2. cluster:
  3. name: elasticsearch
  4. host: 127.0.0.1
  5. port: 9200
  1. SearchRequestBuilder searchRequestBuilder = this.esClient
  2. .prepareSearch(INDEX)
  3. .setTypes(TYPE)
  4. .setQuery(boolQueryBuilder)
  5. .addSort(MovieSearch.RELEASE, SortOrder.DESC)
  6. .setFrom(0)
  7. .setSize(10)
  8. .setFetchSource(includes, null);

抛出错误 :NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{erAdMJ4wTNGxixzYoTGhCw}{127.0.0.1}{127.0.0.1:9200}]]

解决方案:

1、elastic search配置错误,es与java交互的默认端口号是9300,与http交互的端口号是9200,两者不要搞错了,我的就是这种情况,把application.yml配置文件里的es配置的port改为9300即可;

2、如果上述第一步骤还不起作用,则修改下es配置文件elasticsearch.yml中:

  1. network.host: 127.0.0.1
  2. cluster.name: elasticsearch

network.host即部署elastic search服务的机器ip,cluster.name可自定义,但是要和你项目中的elasticsearch.cluster.name值对应。上述两个方式可以顺利解决错误NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{erAdMJ4wTNGxixzYoTGhCw}{127.0.0.1}{127.0.0.1:9200}]]。


books 引申阅读: 使用quartz实现高级定制化定时任务(包含管理界面)

books 推荐阅读:elastic search搜索引擎实战demo:https://github.com/simonsfan/springboot-quartz-demo,分支:feature_es

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

闽ICP备14008679号