ES异常处理-NoNodeAvailableException

1.问题描述

ES client客户端能创建,但是在用客户端操作时报:NoNodeAvailableException[None of the configured nodes are available:[{#transport#-1}{XXXXX}{ip:port}]]。

该问题是客户端无法连接至es服务器,从以下角度排查。

2.解决方案

2.1. 查看配置的ip和端口号是否正确,端口号需要配置tcp端口

2.2 查看cluster name是否正确

2.3 使用的es client版本需要与ES Server版本一致

2.4 如果是运行一段时间后出现的问题,则可能是某个链接的节点出问题了,这时es会自动切换到其他节点访问

2.5 测试环境和生产环境不同,不要拿测试机器访问生产环境

2.6 如果集群开启了访问鉴权,将用户名,密码传入

2.7 client.transport.sniff设置成false,ip:port通过addTransportAddress传入

2.8 netty包冲突,直接引入es client用的netty包版本:

<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.1.16.Final</version>
</dependency>
我的es client是6.3.2用的netty是4.1.6,将其余冲突包中的netty排除:
<exclusion>
<artifactId>netty-all</artifactId>
<groupId>io.netty</groupId>
</exclusion>
按照上述排查,应该能解决问题。
posted @ 2020-09-04 14:45  收纸箱易拉罐  阅读(1701)  评论(0)    收藏  举报