美文网首页
NoNodeAvailableException

NoNodeAvailableException

作者: 站在海边看远方 | 来源:发表于2019-11-05 15:08 被阅读0次

elasticsearch版本:6.8.3
使用java客户端和es进行交互的时候,抛了如下异常:

Exception in thread "main" NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{kRDWAYuFSJmGx-tcjB0L1g}{172.16.17.10}{172.16.17.10:9300}]]
    at org.elasticsearch.client.transport.TransportClientNodesService.ensureNodesAreAvailable(TransportClientNodesService.java:352)
    at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:248)
    at org.elasticsearch.client.transport.TransportProxyClient.execute(TransportProxyClient.java:60)
    at org.elasticsearch.client.transport.TransportClient.doExecute(TransportClient.java:388)
    at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:403)
    at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:391)
    at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:46)
    at org.elasticsearch.action.ActionRequestBuilder.get(ActionRequestBuilder.java:53)
    at com.fc.elastic.TestElastic.main(TestElastic.java:49)

先说结果:

1先修改es server端的elasticsearch.yml配置文件

network.host: 0.0.0.0
network.bind_host: 172.16.17.10
http.cors.enabled: true
http.cors.allow-origin: "*"

bind_host是部署es服务端的机器ip.
http和tcp端口使用了默认值,9200和9300,集群名称使用了默认的集群名称

做如上修改可以解决这个异常问题。

2. 其他配置排查

  • cluster.name 客户端与服务端配置是否相同
  • 使用的端口是否是tcp端口,java客户端与server端交互是使用tcp端口,默认9300

相关文章

  • NoNodeAvailableException

    elasticsearch版本:6.8.3使用java客户端和es进行交互的时候,抛了如下异常: 先说结果: 1先...

  • NoNodeAvailableException[None of

    可能的原因: 1、项目引用的ES版本和ES服务的版本不一样; 2、端口不正确,tcp访问端口是9300; 3、cl...

  • 安装小结

    第一个问题 :Java API:NoNodeAvailableException: No node availab...

  • ES 7.x api 遇到的一些问题

    在接入es的过程中总结了一些出现的问题 1.NoNodeAvailableException[None of th...

网友评论

      本文标题:NoNodeAvailableException

      本文链接:https://www.haomeiwen.com/subject/lunsbctx.html