Elasticsearch Transportclient throws a NoNodeAvailableException in an integration test

So I've a test where I try to connect to a local embedded Elasticsearch
node that usually works with other tests. The embedded node is also local =
true. It works in two other tests, one uses the HTTP Rest API and the other
the data less node client. They both work good.

But when I try to use the TransportClient like this:

Settings settings = ImmutableSettings.settingsBuilder()
.put("client.transport.ignore_cluster_name", false)
.put("cluster.name", clusterName)
.put("client.transport.sniff", false)
.put("client.transport.ping_timeout", pingTimeout)
.put("client.transport.nodes_sampler_interval",pingSamplerInterval
).build();

    client = new TransportClient(settings);


    String hostPieces[] = hosts.split(",");
    for (String piece : hostPieces){
        String hostAndPort[] = piece.trim().split(":");
        if (hostAndPort.length != 2){
            throw new IllegalArgumentException("Error in hosts string: "
  • piece);
    }
    String host = hostAndPort[0].trim();
    String portStr = hostAndPort[1].trim();

          InetSocketTransportAddress address = new 
    

InetSocketTransportAddress(host, Integer.valueOf(portStr));

        client.addTransportAddress(address);
    }

although at the begging it seems to connect to the local node, then it dies:

[2014-04-01 15:31:21,504][DEBUG][org.elasticsearch.client.transport] [Googam
] adding address [[#transport#-1][d][inet[localhost/127.0.0.1:11547]]]
[2014-04-01 15:31:21,517][DEBUG][org.elasticsearch.transport.netty] [Googam]connected to node
[[#transport#-1][d][inet[localhost/127.0.0.1:11547]]]
[2014-04-01 15:31:31,316][DEBUG][org.elasticsearch.cluster.service] [
Sepulchre] processing [routing-table-updater]: execute
[2014-04-01 15:31:31,317][DEBUG][org.elasticsearch.cluster.service] [
Sepulchre] processing [routing-table-updater]: no change in cluster_state
[2014-04-01 15:32:16,521][INFO ][org.elasticsearch.client.transport] [Googam
] failed to get node info for [#transport#-1][d][inet[localhost/127.0.0.1:11547]],
disconnecting...
org.elasticsearch.transport.ReceiveTimeoutTransportException: [][inet[
localhost/127.0.0.1:11547]][cluster/nodes/info] request_id [0] timed outafter
[55001ms]
at org.elasticsearch.transport.TransportService$TimeoutHandler.run(
TransportService.java:356)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)
at java.lang.Thread.run(Thread.java:724)
[2014-04-01 15:32:16,525][DEBUG][org.elasticsearch.transport.netty] [Googam]disconnected
from [[#transport#-1][d][inet[localhost/127.0.0.1:11547]]]
[2014-04-01 15:32:16,527][DEBUG][org.elasticsearch.transport.netty] [Googam]connected to node
[[#transport#-1][d][inet[localhost/127.0.0.1:11547]]]
[2014-04-01 15:32:16,530][INFO ][org.elasticsearch.node ] [Sepulchre]stopping
...
[2014-04-01 15:32:16,530][DEBUG][org.elasticsearch.transport.netty] [Googam]disconnected
from [[#transport#-1][d][inet[localhost/127.0.0.1:11547]]], channel closed
event
[2014-04-01 15:32:16,532][INFO ][org.elasticsearch.client.transport] [Googam
] failed to get node info for [#transport#-1][d][inet[localhost/127.0.0.1:11547]],
disconnecting...
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/
127.0.0.1:11547]][cluster/nodes/info] disconnected
[2014-04-01 15:32:16,534][INFO ][org.elasticsearch.node ] [Sepulchre]stopped
Exception in thread "Thread-1" org.elasticsearch.client.transport.
NoNodeAvailableException: No node available

In the log you have Googam that is the TransportClient and Sepulchre that
is the embedded node.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/1a8729d1-aa82-4dc8-857c-52c633ac540a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Is the transportclient working on port 9300 to begin with?

On Tuesday, April 1, 2014 11:04:43 AM UTC-4, Dario Rossi wrote:

So I've a test where I try to connect to a local embedded Elasticsearch
node that usually works with other tests. The embedded node is also local =
true. It works in two other tests, one uses the HTTP Rest API and the other
the data less node client. They both work good.

But when I try to use the TransportClient like this:

Settings settings = ImmutableSettings.settingsBuilder()
.put("client.transport.ignore_cluster_name", false)
.put("cluster.name", clusterName)
.put("client.transport.sniff", false)
.put("client.transport.ping_timeout", pingTimeout)
.put("client.transport.nodes_sampler_interval",pingSamplerInterval
).build();

    client = new TransportClient(settings);


    String hostPieces[] = hosts.split(",");
    for (String piece : hostPieces){
        String hostAndPort[] = piece.trim().split(":");
        if (hostAndPort.length != 2){
            throw new IllegalArgumentException("Error in hosts 

string: "+ piece);
}
String host = hostAndPort[0].trim();
String portStr = hostAndPort[1].trim();

        InetSocketTransportAddress address = new 

InetSocketTransportAddress(host, Integer.valueOf(portStr));

        client.addTransportAddress(address);
    }

although at the begging it seems to connect to the local node, then it
dies:

[2014-04-01 15:31:21,504][DEBUG][org.elasticsearch.client.transport] [
Googam] adding address [[
#transport#-1][d][inet[localhost/127.0.0.1:11547]]]
[2014-04-01 15:31:21,517][DEBUG][org.elasticsearch.transport.netty] [
Googam] connected to node [[
#transport#-1][d][inet[localhost/127.0.0.1:11547]]]
[2014-04-01 15:31:31,316][DEBUG][org.elasticsearch.cluster.service] [
Sepulchre] processing [routing-table-updater]: execute
[2014-04-01 15:31:31,317][DEBUG][org.elasticsearch.cluster.service] [
Sepulchre] processing [routing-table-updater]: no change in cluster_state
[2014-04-01 15:32:16,521][INFO ][org.elasticsearch.client.transport] [
Googam] failed to get node info for [#transport#-1][d][inet[localhost/127.0.0.1:11547]],
disconnecting...
org.elasticsearch.transport.ReceiveTimeoutTransportException: [inet[
localhost/127.0.0.1:11547]][cluster/nodes/info] request_id [0] timed outafter
[55001ms]
at org.elasticsearch.transport.TransportService$TimeoutHandler.run(
TransportService.java:356)
at java.util.concurrent.ThreadPoolExecutor.runWorker(
ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(
ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
[2014-04-01 15:32:16,525][DEBUG][org.elasticsearch.transport.netty] [
Googam] disconnected from [[
#transport#-1][d][inet[localhost/127.0.0.1:11547]]]
[2014-04-01 15:32:16,527][DEBUG][org.elasticsearch.transport.netty] [
Googam] connected to node [[
#transport#-1][d][inet[localhost/127.0.0.1:11547]]]
[2014-04-01 15:32:16,530][INFO ][org.elasticsearch.node ] [Sepulchre]stopping
...
[2014-04-01 15:32:16,530][DEBUG][org.elasticsearch.transport.netty] [
Googam] disconnected from [[#transport#-1][d][inet[localhost/127.0.0.1:11547]]],
channel closed event
[<span style="color: #066;" class="styled-by-prettify"
...

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/2512ceda-0ca9-4d98-8748-6cd2df7f0865%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

The embedded data node uses port 11547 (this setting is working with a data
less node without any problem).

Il giorno martedì 1 aprile 2014 16:15:57 UTC+1, IronMan2014 ha scritto:

Is the transportclient working on port 9300 to begin with?

On Tuesday, April 1, 2014 11:04:43 AM UTC-4, Dario Rossi wrote:

So I've a test where I try to connect to a local embedded Elasticsearch
node that usually works with other tests. The embedded node is also local =
true. It works in two other tests, one uses the HTTP Rest API and the other
the data less node client. They both work good.

But when I try to use the TransportClient like this:

Settings settings = ImmutableSettings.settingsBuilder()
.put("client.transport.ignore_cluster_name", false)
.put("cluster.name", clusterName)
.put("client.transport.sniff", false)
.put("client.transport.ping_timeout", pingTimeout)
.put("client.transport.nodes_sampler_interval",pingSamplerInterval
).build();

    client = new TransportClient(settings);


    String hostPieces[] = hosts.split(",");
    for (String piece : hostPieces){
        String hostAndPort[] = piece.trim().split(":");
        if (hostAndPort.length != 2){
            throw new IllegalArgumentException("Error in hosts 

string: "+ piece);
}
String host = hostAndPort[0].trim();
String portStr = hostAndPort[1].trim();

        InetSocketTransportAddress address = new 

InetSocketTransportAddress(host, Integer.valueOf(portStr));

        client.addTransportAddress(address);
    }

although at the begging it seems to connect to the local node, then it
dies:

[2014-04-01 15:31:21,504][DEBUG][org.elasticsearch.client.transport] [
Googam] adding address [[
#transport#-1][d][inet[localhost/127.0.0.1:11547]]]
[2014-04-01 15:31:21,517][DEBUG][org.elasticsearch.transport.netty] [
Googam] connected to node [[
#transport#-1][d][inet[localhost/127.0.0.1:11547]]]
[2014-04-01 15:31:31,316][DEBUG][org.elasticsearch.cluster.service] [
Sepulchre] processing [routing-table-updater]: execute
[2014-04-01 15:31:31,317][DEBUG][org.elasticsearch.cluster.service] [
Sepulchre] processing [routing-table-updater]: no change in cluster_state
[2014-04-01 15:32:16,521][INFO ][org.elasticsearch.client.transport] [
Googam] failed to get node info for [#transport#-1][d][inet[localhost/127.0.0.1:11547]],
disconnecting...
org.elasticsearch.transport.ReceiveTimeoutTransportException: [inet[
localhost/127.0.0.1:11547]][cluster/nodes/info] request_id [0] timed outafter
[55001ms]
at org.elasticsearch.transport.TransportService$TimeoutHandler.run(
TransportService.java:356)
at java.util.concurrent.ThreadPoolExecutor.runWorker(
ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(
ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
[2014-04-01 15:32:16,525][DEBUG][org.elasticsearch.transport.netty] [
Googam] disconnected from [[
#transport#-1][d][inet[localhost/127.0.0.1:11547]]]
[2014-04-01 15:32:16,527][DEBUG][org.elasticsearch.transport.netty] [
Googam] connected to node [[
#transport#-1][d][inet[localhost/127.0.0.1:11547]]]
[2014-04-01 15:32:16,530][INFO ][org.elasticsearch.node ] [Sepulchre]stopping
...
[2014-04-01 15:32:16,530][DEBUG][org.elasticsearch.transport.netty] [
Googam] disconnected from [[#transport#-1][d][inet[localhost/127.0.0.1:11547]]],
channel closed event
[<span style="color: #066;" class="styled-by-prettify"
...

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/e69a4b68-44ed-4daa-bba6-f1544b6e32a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Not sure, From my experience, there are two things to check, The client and
server versions have to match and make sure ports are opened. Like I
mentioned, check with 9300 to make sure it's working there at least.

On Tuesday, April 1, 2014 11:19:22 AM UTC-4, Dario Rossi wrote:

The embedded data node uses port 11547 (this setting is working with a
data less node without any problem).

Il giorno martedì 1 aprile 2014 16:15:57 UTC+1, IronMan2014 ha scritto:

Is the transportclient working on port 9300 to begin with?

On Tuesday, April 1, 2014 11:04:43 AM UTC-4, Dario Rossi wrote:

So I've a test where I try to connect to a local embedded Elasticsearch
node that usually works with other tests. The embedded node is also local =
true. It works in two other tests, one uses the HTTP Rest API and the other
the data less node client. They both work good.

But when I try to use the TransportClient like this:

Settings settings = ImmutableSettings.settingsBuilder()
.put("client.transport.ignore_cluster_name", false)
.put("cluster.name", clusterName)
.put("client.transport.sniff", false)
.put("client.transport.ping_timeout", pingTimeout)
.put("client.transport.nodes_sampler_interval",pingSamplerInterval
).build();

    client = new TransportClient(settings);


    String hostPieces[] = hosts.split(",");
    for (String piece : hostPieces){
        String hostAndPort[] = piece.trim().split(":");
        if (hostAndPort.length != 2){
            throw new IllegalArgumentException("Error in hosts 

string: "+ piece);
}
String host = hostAndPort[0].trim();
String portStr = hostAndPort[1].trim();

        InetSocketTransportAddress address = new 

InetSocketTransportAddress(host, Integer.valueOf(portStr));

        client.addTransportAddress(address);
    }

although at the begging it seems to connect to the local node, then it
dies:

[2014-04-01 15:31:21,504][DEBUG][org.elasticsearch.client.transport] [
Googam] adding address [[
#transport#-1][d][inet[localhost/127.0.0.1:11547]]]
[2014-04-01 15:31:21,517][DEBUG][org.elasticsearch.transport.netty] [
Googam] connected to node [[
#transport#-1][d][inet[localhost/127.0.0.1:11547]]]
[2014-04-01 15:31:31,316][DEBUG][org.elasticsearch.cluster.service] [
Sepulchre] processing [routing-table-updater]: execute
[2014-04-01 15:31:31,317][DEBUG][org.elasticsearch.cluster.service] [
Sepulchre] processing [routing-table-updater]: no change incluster_state
[2014-04-01 15:32:16,521][INFO ][org.elasticsearch.client.transport] [
Googam] failed to get node info for [#transport#-1][d][inet[localhost/127.0.0.1:11547]],
disconnecting...
org.elasticsearch.transport.ReceiveTimeoutTransportException: [inet[
localhost/127.0.0.1:11547]][cluster/nodes/info] request_id [0] timed outafter
[55001ms]
at org.elasticsearch.transport.TransportService$TimeoutHandler.run(
TransportService.java:356)
at java.util.concurrent.ThreadPoolExecutor.runWorker(
ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(
ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
[2014-04-01 15:32:16,525][DEBUG][org.elasticsearch.transport.netty] [
Googam] disconnected from [[
#transport#-1][d][inet[localhost/127.0.0.1:11547]]]
[2014-04-01 15:32:16,527][DEBUG][org.elasticsearch.transport.netty] [
Googam] connected to node [[
#transport#-1][d][inet[localhost/127.0.0.1:11547]]]
[2014-04-01 15:32:16,530][INFO ][org.elasticsearch.node ] [Sepulchre]stopping
...
[2014-04-01 15:32:16,530][DEBUG][org.elasticsearch.transport.netty] [
Googam] disconnected from [[#transport#-1][d][inet[localhost/127.0.0.1:11547]]],
channel closed event
[<span style="color: #066;" class="styled-by-prettify"
...

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/cf53efd0-5246-41ac-b35c-966d7cb5a5d0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.