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 [email protected].
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.

Reply via email to