Elasticsearch 7.x NoNodeAvailableException: None of the configured nodes are available - Go语言中文社区

Elasticsearch 7.x NoNodeAvailableException: None of the configured nodes are available


		<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-elasticsearch</artifactId>
        </dependency>
spring.data.elasticsearch.cluster-name=es
spring.data.elasticsearch.cluster-nodes=10.17.12.158:9300
spring.data.elasticsearch.repositories.enabled=true

集群方式

failed to load elasticsearch nodes : 
org.elasticsearch.client.transport.NoNodeAvailableException:
None of the configured nodes are available:
[{#transport#-1}{HiXBU0PNRV6j7QDw9ZcyNw}{10.17.12.158}{10.17.12.158:9300}, {#transport#-2}{fA87OUrESfCfixlGYDQF3Q}{10.17.12.159}{10.17.12.159:9300}, {#transport#-3}{f7qINyogSoqUf6pv4Gt3Mw}{10.17.12.160}{10.17.12.160:9300}]

单节点

failed to load elasticsearch nodes : org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: [{#transport#-1}{av8BbMdQSe-Ys7hGal7LDw}{10.17.12.158}{10.17.12.158:9300}]

初步判定,应该是spring-boot-starter-data-elasticsearch与Elasticsearch 7.x版本不兼容造成的。

通过测试发现,将Elasticsearch降级到6.x版本,即可解决。

【2019-08-22】更新

最新版本

<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-data-elasticsearch -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-elasticsearch</artifactId>
    <version>2.1.7.RELEASE</version>
</dependency>

由https://mvnrepository.com网页可知,spring-boot-starter-data-elasticsearch编译依赖于spring-boot-starter和 spring-data-elasticsearch,进一步知道spring-data-elasticsearch的最新版本时3.1.10
在这里插入图片描述
通过github网址:https://github.com/spring-projects/spring-data-elasticsearch
可知当前最新发布版是3.1版本,对应Elasticsearch版本时6.2.2,尚不支持Elasticsearch 7.x版本
在这里插入图片描述

解决办法

2019年11月6日更新
springboot 2.2整合elasticsearch 7.x请参考
https://blog.csdn.net/chengyuqiang/article/details/102938266

版权声明:本文来源CSDN,感谢博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/chengyuqiang/article/details/95192857
站方申明:本站部分内容来自社区用户分享,若涉及侵权,请联系站方删除。
  • 发表于 2020-02-25 01:06:40
  • 阅读 ( 1764 )
  • 分类:

0 条评论

请先 登录 后评论

官方社群

GO教程

猜你喜欢