简体   繁体   English

Ubuntu 14.04上的ElasticSearch Java Transport Client NoNodeAvailableException

[英]ElasticSearch Java Transport Client NoNodeAvailableException on Ubuntu 14.04

I am running Elasticsearch v. 2.3.2 , using Java 7. Following is the printout from curl http://172.31.11.83:9200 : 我正在使用Java 7运行Elasticsearch v.3.2.2 ,以下是curl http://172.31.11.83:9200的打印输出:

{
  "name" : "ip-172-31-11-83",
  "cluster_name" : "elasticsearch",
  "version" : {
      "number" : "2.3.2",
      "build_hash" : "b9e4a6acad4008027e4038f6abed7f7dba346f94",
      "build_timestamp" : "2016-04-21T16:03:47Z",
      "build_snapshot" : false,
      "lucene_version" : "5.5.0"
    },
  "tagline" : "You Know, for Search"
}

... and I am using the following in my Java code: ...并且我在Java代码中使用以下代码:

<dependency>
    <groupId>org.elasticsearch</groupId>
    <artifactId>elasticsearch</artifactId>
    <version>2.3.2</version>
</dependency>

I have ports 9200 and 9300 open in my firewall rules for my ES server, and can successfully execute said Java code from my laptop (Mac OSX). 我的 ES服务器的防火墙规则中有9200和9300端口处于打开状态 ,并且可以从笔记本电脑(Mac OSX)成功执行上述Java代码。 Following is the code snippet that starts off the process (this works fine): 以下是开始该过程的代码片段(工作正常):

Settings settings = Settings.settingsBuilder()
                .put("cluster.name", "elasticsearch").build();
        esClient =TransportClient.builder().settings(settings).build().addTransportAddress(new 
                InetSocketTransportAddress(new InetSocketAddress(InetAddress.getByName("172.31.11.83"), 9300)));

Then later, I try to issue an index request (this fails when I run the code on Ubuntu 14.04 : 然后,稍后,我尝试发出索引请求(当我在Ubuntu 14.04上运行代码时,此请求失败:

adminClient = esClient.admin().indices();
IndicesExistsResponse response = adminClient.exists(request).actionGet();

My elasticsearch.yml file contains the following network settings: 我的elasticsearch.yml文件包含以下网络设置:

network.bind_host: 0
network.publish_host: 172.31.11.83
transport.tcp.port: 9300
http.port: 9200

I have also tried with network.bind_host: 172.31.11.83 to no avail. 我也尝试了network.bind_host: 172.31.11.83无济于事。 Using curl , I can get to port 9200 from all machines. 使用curl ,我可以从所有计算机访问端口9200。 The cluster name reported by curl is "elasticsearch" . curl报告的群集名称为“ elasticsearch”

When I start ES, I see the following in the elasticsearch.log : 启动ES时,在elasticsearch.log中看到以下内容:

publish_address {172.31.11.83:9300}, bound_addresses {[::]:9300}

And yet, the exception I get is as follows: 但是,我得到的异常如下:

NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{172.31.11.83}{172.31.11.83:9300}]]
at org.elasticsearch.client.transport.TransportClientNodesService.ensureNodesAreAvailable(TransportClientNodesService.java:290)
at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:207)
at org.elasticsearch.client.transport.support.TransportProxyClient.execute(TransportProxyClient.java:55)
at org.elasticsearch.client.transport.TransportClient.doExecute(TransportClient.java:283)
at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:347)
at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:336)
at org.elasticsearch.client.support.AbstractClient$IndicesAdmin.execute(AbstractClient.java:1178)
at org.elasticsearch.client.support.AbstractClient$IndicesAdmin.exists(AbstractClient.java:1198)

Again, this exact code works from my local machine. 同样,此确切的代码可以在我的本地计算机上运行。 Any thoughts? 有什么想法吗?

Having identical issue.. 有相同的问题。

Upgraded elastic from 1.7 to 2.3.2 on same AWS kit 在同一AWS套件上将弹性从1.7升级到2.3.2

Ubunto 14.0.4 乌本图14.0.4

Elastic binding transport on 9300 as before 像以前一样在9300上进行弹性绑定传输

Security group has port open (not changed) 安全组已打开端口(未更改)

Now remote clients cannot connect via transport layer - same error as above. 现在,远程客户端无法通过传输层连接-与上述相同的错误。

The only thing that has changed in my setup is the version of Elasticsearch 我的设置中唯一发生变化的是Elasticsearch的版本

ok I solved this. 好的,我解决了这个问题。 It appears 2.3.2 doesn't default TCP bind in same way as 1.7.0 似乎2.3.2没有默认的TCP绑定与1.7.0相同

I had to set this in my elasticsearch.yml : 我必须在我的elasticsearch.yml中设置它:

network.bind_host: {AWS private IP address) network.bind_host:{AWS专用IP地址)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Elasticsearch 的 Java 传输客户端抛出 NoNodeAvailableException - Java Transport Client for Elasticsearch throws NoNodeAvailableException 索引编制上的org.elasticsearch.client.transport.NoNodeAvailableException - org.elasticsearch.client.transport.NoNodeAvailableException on indexing org.elasticsearch.client.transport.NoNodeAvailableException - org.elasticsearch.client.transport.NoNodeAvailableException Elasticsearch 5 Java客户端提供“NoNodeAvailableException” - Elasticsearch 5 Java Client giving “NoNodeAvailableException” elasticserch:org.elasticsearch.client.transport.NoNodeAvailableException:没有可用的节点 - elasticserch: org.elasticsearch.client.transport.NoNodeAvailableException: No node available org.elasticsearch.client.transport.NoNodeAvailableException:没有配置的节点可用:[] - org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: [] elasticsearch和java-InvocationTargetException和NoNodeAvailableException - elasticsearch & java - InvocationTargetException and NoNodeAvailableException Elasticsearch Transport客户端Java客户端 - Elasticsearch transport client java client 线程“主”中的异常org.elasticsearch.client.transport.NoNodeAvailableException:无可用节点 - Exception in thread “main” org.elasticsearch.client.transport.NoNodeAvailableException: No node available 启动声纳时,出现以下异常:org.elasticsearch.client.transport.NoNodeAvailableException:无可用节点 - When starting sonar, I get the following exception: org.elasticsearch.client.transport.NoNodeAvailableException: No node available
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM