NoNodeAvailableException[None of the configured nodes are available异常解决方法总结

在使用elasticsearch时报错:

 [None of the configured nodes are available: [{#transport#-1}{wXgtIC2KRUyygVQIJeSrFA}{127.0.0.1}{127.0.0.1:9300}]]
	NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{wXgtIC2KRUyygVQIJeSrFA}{127.0.0.1}{127.0.0.1:9300}]]
		at org.elasticsearch.client.transport.TransportClientNodesService.ensureNodesAreAvailable(TransportClientNodesService.java:347)
		at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:245)
		at org.elasticsearch.client.transport.TransportProxyClient.execute(TransportProxyClient.java:59)
		at org.elasticsearch.client.transport.TransportClient.doExecute(TransportClient.java:366)
		at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:408)
		at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:80)
		at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:54)

原因1:spring-data-elasticsearch与elasticsearch版本不匹配,版本不一致将会导致报错。
在这里插入图片描述

原因2:配置文件elasticsearch.yml中cluster.name与项目里的不一致会导致报错。
修改elasticsearch.yml时一定要注意使用utf-8编码,英文编写,不然修改过后启动会出现闪退的情况。
修改后elasticsearch.yml:
在这里插入图片描述
springboot中,本人使用的properties方式配置,springboot中使用yml同理。:
在这里插入图片描述

spring.data.elasticsearch.cluster-name=my-application

原因3:如果还不行检查配置文件中节点是否为9300。
9200作为Http协议,主要用于外部通讯

9300作为Tcp协议,jar之间就是通过tcp协议通讯

ES集群之间是通过9300进行通讯
在这里插入图片描述

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值