org.elasticsearch.client.transport.NoNodeAvailableException。。解决办法

终于,终于,终于,

   解决了。

看到了很多版本的答案,却始终没有解决问题,

查看了源码,看了配置文件,终于解决了。

分享给大家。

Exception in thread "main" org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available:

    at org.elasticsearch.client.transport.TransportClientNodesService.ensureNodesAreAvailable(TransportClientNodesService.java:278)
    at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:197)
    at org.elasticsearch.client.transport.support.InternalTransportClient.execute(InternalTransportClient.java:106)
    at org.elasticsearch.client.support.AbstractClient.bulk(AbstractClient.java:163)
    at org.elasticsearch.client.transport.TransportClient.bulk(TransportClient.java:364)
    at org.elasticsearch.action.bulk.BulkRequestBuilder.doExecute(BulkRequestBuilder.java:164)
    at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:91)
    at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:65)
    at com.hansight.utils.EsUtils.importData(EsUtils.java:134)

    at com.hansight.utils.EsUtils.main(EsUtils.java:173)

解决思路:

1.查看

	luster.name,是否是你服务器上在elasticsearch.yml上配置的
  
      2.查看
 	port:9300
	val client = TransportClient.builder().settings(settings).build()
  .addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("******"), 9300))
      3.查看
       服务器的防火墙,是否关了。
    
      4.查看
         如果设置client.transport.sniff为true,则表示客户端去嗅探整个cluster的状态,把集群中其它机器的ip地址加到客户端中
      
       
         

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值