# NodesNotAvailable for java client

**URL:** <https://discuss.elastic.co/t/nodesnotavailable-for-java-client/68011>\
**Category:** Elasticsearch\
**Created:** [December 5, 2016, 9:28am UTC](https://discuss.elastic.co/t/nodesnotavailable-for-java-client/68011 "2016-12-05T09:28:48Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![nugusbayevkk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nugusbayevkk/32/126683_2.png) [@nugusbayevkk](https://discuss.elastic.co/u/nugusbayevkk)\
**Post date:** [December 5, 2016, 9:28am UTC](https://discuss.elastic.co/t/nodesnotavailable-for-java-client/68011/1 "2016-12-05T09:28:48Z")

</div>

Hello Elastic Team.  
My name is Kanagat.  
I am trying configurate connection to Elk node from java by transport client.But i get exception: noNodesAvailable.

next my ELK configuration running on server with name XXX:  
elasticsearch-5.0.2] cat ./config/elasticsearch.yml |grep -v "#" |grep -v "^"

cluster.name: eventhandler-test-db  
node.name: node-3  
node.master: true  
node.data: true  
path.logs: /data/nugusbayev\_repo/logs/elasticsearch/node3  
network.publish\_host: SERVER\_NAME  
network.bind\_host: 0.0.0.0  
discovery.zen.ping.unicast.hosts: ["127.0.0.1", "localhost","SERVER\_NAME"]

curl localhost:9200  
{  
"name" : "node-3",  
"cluster\_name" : "eventhandler-test-db",  
"cluster\_uuid" : "xb38NQ14SNuyh1eUKA0LbA",  
"version" : {  
"number" : "5.0.2",  
"build\_hash" : "f6b4951",  
"build\_date" : "2016-11-24T10:07:18.101Z",  
"build\_snapshot" : false,  
"lucene\_version" : "6.2.1"  
},  
"tagline" : "You Know, for Search"  
}  
SERVER\_NAME:9200  
this url permitted(accesed) from any PC in our network.

Then i tried use in java project  
Settings settings = Settings.builder().put("cluster.name", "eventhandler-test-db").build();  
TransportClient client = new PreBuiltTransportClient(settings);  
client.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("SERVER\_NAME"), 9300));  
System.out.println("QQQ" + client.connectedNodes());

But client not return any nodes.  
Can you help me what's wrong in my configuration?

In addition i add the screen of used libraries.

 ![](https://us1.discourse-cdn.com/elastic/original/2X/6/62584b97426074d73bd5351b3699035f4ded353d.JPG)

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [December 5, 2016, 9:55am UTC](https://discuss.elastic.co/t/nodesnotavailable-for-java-client/68011/2 "2016-12-05T09:55:08Z")

</div>

Hey,

try to also configure the cluster name in your transport client settings.

See [configuring the transport client](https://www.elastic.co/guide/en/elasticsearch/client/java-api/5.0/transport-client.html)

--Alex

---

<div class="post-metadata">

**Author:** ![nugusbayevkk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nugusbayevkk/32/126683_2.png) [@nugusbayevkk](https://discuss.elastic.co/u/nugusbayevkk)\
**Post date:** [December 5, 2016, 10:07am UTC](https://discuss.elastic.co/t/nodesnotavailable-for-java-client/68011/3 "2016-12-05T10:07:21Z")

</div>

Alex, thanks you.  
But i configured by that instructions.  
It didn't work.

Settings settings = Settings.builder().put("[cluster.name](http://cluster.name)", "eventhandler-test-db").build();  
TransportClient client = new PreBuiltTransportClient(settings);  
client.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("SERVER\_NAME"), 9300));  
System.out.println("QQQ" + client.connectedNodes());

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [December 5, 2016, 10:13am UTC](https://discuss.elastic.co/t/nodesnotavailable-for-java-client/68011/4 "2016-12-05T10:13:21Z")

</div>

Hey,

sorry I missed that - didnt have any coffee yet.

Can you configure the settings `logger.level` to `debug` or `trace` on the `TransportClient`, try again and paste the output?

--Alex

---

<div class="post-metadata">

**Author:** ![nugusbayevkk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nugusbayevkk/32/126683_2.png) [@nugusbayevkk](https://discuss.elastic.co/u/nugusbayevkk)\
**Post date:** [December 5, 2016, 10:23am UTC](https://discuss.elastic.co/t/nodesnotavailable-for-java-client/68011/5 "2016-12-05T10:23:05Z")

</div>

I configure with command:  
curl -XPUT localhost:9200/\_cluster/settings -d '{  
"transient" : {  
"logger.org.elasticsearch.transport.TransportService.tracer" : "TRACE"  
}  
}'  
Then in the log file appeared next rows:

[2016-12-05T16:21:24,403][TRACE][o.e.t.T.tracer] [node-3] [111][cluster:monitor/nodes/stats[n]] received response from [{node-3}{UkLFi01ZTym58721RqGSBw}{VD0lbEHaT\_yCodRoQBXf\_Q}{10.17.100.194}{1  
0.17.100.194:9300}]  
[2016-12-05T16:21:24,404][TRACE][o.e.t.T.tracer] [node-3] [112][indices:monitor/stats[n]] received response from [{node-3}{UkLFi01ZTym58721RqGSBw}{VD0lbEHaT\_yCodRoQBXf\_Q}{10.17.100.194}{10.17.1  
00.194:9300}]  
[2016-12-05T16:21:54,406][TRACE][o.e.t.T.tracer] [node-3] [113][cluster:monitor/nodes/stats[n]] received response from [{node-3}{UkLFi01ZTym58721RqGSBw}{VD0lbEHaT\_yCodRoQBXf\_Q}{10.17.100.194}{1  
0.17.100.194:9300}]  
[2016-12-05T16:21:54,407][TRACE][o.e.t.T.tracer] [node-3] [114][indices:monitor/stats[n]] received response from [{node-3}{UkLFi01ZTym58721RqGSBw}{VD0lbEHaT\_yCodRoQBXf\_Q}{10.17.100.194}{10.17.1  
00.194:9300}]

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [December 5, 2016, 10:40am UTC](https://discuss.elastic.co/t/nodesnotavailable-for-java-client/68011/6 "2016-12-05T10:40:56Z")

</div>

Hey,

you need to put this into the settings of the transportclient, not anywhere on the server.

--Alex

---

<div class="post-metadata">

**Author:** ![nugusbayevkk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nugusbayevkk/32/126683_2.png) [@nugusbayevkk](https://discuss.elastic.co/u/nugusbayevkk)\
**Post date:** [December 5, 2016, 10:53am UTC](https://discuss.elastic.co/t/nodesnotavailable-for-java-client/68011/7 "2016-12-05T10:53:34Z")

</div>

I set next configuration:  
Settings settings = Settings.builder().put("[cluster.name](http://cluster.name)", "first").put("logger.org.elasticsearch.transport.TransportService.tracer", "TRACE")  
.build();  
is it correct?  
Then in output of my java client i get next rows:  
no modules loaded  
loaded plugin [org.elasticsearch.index.reindex.ReindexPlugin]  
loaded plugin [org.elasticsearch.percolator.PercolatorPlugin]  
loaded plugin [org.elasticsearch.script.mustache.MustachePlugin]  
loaded plugin [org.elasticsearch.transport.Netty3Plugin]  
loaded plugin [org.elasticsearch.transport.Netty4Plugin]  
exception caught on transport layer [[id: 0xb6ac86c5, L:/MY\_COMPUTER\_IP:58108 - R:grafana-dashboard-d/10.17.100.194:9300]], closing connection  
org.elasticsearch.ElasticsearchException: java.lang.AbstractMethodError: org.elasticsearch.common.io.stream.StreamInput.ensureCanReadBytes(I)V  
at org.elasticsearch.transport.netty4.Netty4Transport.exceptionCaught(Netty4Transport.java:326) [transport-netty4-client-5.0.1.jar:5.0.1] at org.elasticsearch.transport.netty4.Netty4Transport.exceptionCaught(Netty4Transport.java:326) [transport-netty4-client-5.0.1.jar:5.0.1]  
at org.elasticsearch.transport.netty4.Netty4MessageChannelHandler.exceptionCaught(Netty4MessageChannelHandler.java:83) [transport-netty4-client-5.0.1.jar:5.0.1]  
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:296) [netty-transport-4.1.6.Final.jar:4.1.6.Final]  
at io.netty.channel.AbstractChannelHandlerContext.notifyHandlerException(AbstractChannelHandlerContext.java:861) [netty-transport-4.1.6.Final.jar:4.1.6.Final]  
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:375) [netty-transport-4.1.6.Final.jar:4.1.6.Final]  
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:359) [netty-transport-4.1.6.Final.jar:4.1.6.Final]  
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:351) [netty-transport-4.1.6.Final.jar:4.1.6.Final]  
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293) [netty-codec-4.1.6.Final.jar:4.1.6.Final]  
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:280) [netty-codec-4.1.6.Final.jar:4.1.6.Final]  
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:396) [netty-codec-4.1.6.Final.jar:4.1.6.Final]  
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:248) [netty-codec-4.1.6.Final.jar:4.1.6.Final]  
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:373) [netty-transport-4.1.6.Final.jar:4.1.6.Final]  
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:359) [netty-transport-4.1.6.Final.jar:4.1.6.Final]  
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:351) [netty-transport-4.1.6.Final.jar:4.1.6.Final]  
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334) [netty-transport-4.1.6.Final.jar:4.1.6.Final]  
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:373) [netty-transport-4.1.6.Final.jar:4.1.6.Final]  
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:359) [netty-transport-4.1.6.Final.jar:4.1.6.Final]  
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926) [netty-transport-4.1.6.Final.jar:4.1.6.Final]  
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:129) [netty-transport-4.1.6.Final.jar:4.1.6.Final]  
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:651) [netty-transport-4.1.6.Final.jar:4.1.6.Final]  
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:574) [netty-transport-4.1.6.Final.jar:4.1.6.Final]  
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:488) [netty-transport-4.1.6.Final.jar:4.1.6.Final]  
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:450) [netty-transport-4.1.6.Final.jar:4.1.6.Final]  
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:873) [netty-common-4.1.6.Final.jar:4.1.6.Final]  
at java.lang.Thread.run(Thread.java:745) [?:1.8.0\_65]

---

<div class="post-metadata">

**Author:** ![nugusbayevkk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nugusbayevkk/32/126683_2.png) [@nugusbayevkk](https://discuss.elastic.co/u/nugusbayevkk)\
**Post date:** [December 5, 2016, 10:54am UTC](https://discuss.elastic.co/t/nodesnotavailable-for-java-client/68011/8 "2016-12-05T10:54:15Z")

</div>

Caused by: java.lang.AbstractMethodError: org.elasticsearch.common.io.stream.StreamInput.ensureCanReadBytes(I)V  
at org.elasticsearch.common.io.stream.FilterStreamInput.ensureCanReadBytes(FilterStreamInput.java:80) ~[elasticsearch-5.0.2.jar:5.0.2]  
at org.elasticsearch.common.io.stream.StreamInput.readArraySize(StreamInput.java:892) ~[elasticsearch-5.0.2.jar:5.0.2]  
at org.elasticsearch.common.io.stream.StreamInput.readMapOfLists(StreamInput.java:456) ~[elasticsearch-5.0.2.jar:5.0.2]  
at org.elasticsearch.common.util.concurrent.ThreadContext$ThreadContextStruct.(ThreadContext.java:286) ~[elasticsearch-5.0.2.jar:5.0.2]  
at org.elasticsearch.common.util.concurrent.ThreadContext$ThreadContextStruct.(ThreadContext.java:273) ~[elasticsearch-5.0.2.jar:5.0.2]  
at org.elasticsearch.common.util.concurrent.ThreadContext.readHeaders(ThreadContext.java:135) ~[elasticsearch-5.0.2.jar:5.0.2]  
at org.elasticsearch.transport.TcpTransport.messageReceived(TcpTransport.java:1203) [elasticsearch-5.0.2.jar:5.0.2]  
at org.elasticsearch.transport.netty4.Netty4MessageChannelHandler.channelRead(Netty4MessageChannelHandler.java:74) ~[transport-netty4-client-5.0.1.jar:5.0.1]  
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:373) ~[netty-transport-4.1.6.Final.jar:4.1.6.Final]  
... 20 more  
failed to get node info for {#transport#-1}{sv\_5dnK0QrejxHqg6Uo8Yg}{10.17.100.194}{10.17.100.194:9300}, disconnecting...  
org.elasticsearch.transport.NodeDisconnectedException: [][10.17.100.194:9300][cluster:monitor/nodes/liveness] disconnected  
QQQ[]  
at org.elasticsearch.transport.netty4.Netty4Transport.exceptionCaught(Netty4Transport.java:326) [transport-netty4-client-5.0.1.jar:5.0.1]

---

<div class="post-metadata">

**Author:** ![nugusbayevkk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nugusbayevkk/32/126683_2.png) [@nugusbayevkk](https://discuss.elastic.co/u/nugusbayevkk)\
**Post date:** [December 5, 2016, 10:58am UTC](https://discuss.elastic.co/t/nodesnotavailable-for-java-client/68011/9 "2016-12-05T10:58:50Z")

</div>

Alex, i solved problem..  
I replace 2 libraries:  
transport-netty3-client-5.0.1 to transport-netty3-client-5.0.2  
transport-netty4-client-5.0.1 to transport-netty3-client-5.0.2

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![nugusbayevkk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nugusbayevkk/32/126683_2.png) [@nugusbayevkk](https://discuss.elastic.co/u/nugusbayevkk)\
**Post date:** [December 5, 2016, 11:00am UTC](https://discuss.elastic.co/t/nodesnotavailable-for-java-client/68011/10 "2016-12-05T11:00:59Z")

</div>

after increas the log level, i saw problem with no class found:

then i added netty handler -4.1.6.

Then i got message from my last reply.

After replace, nodes is now available.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [December 5, 2016, 12:24pm UTC](https://discuss.elastic.co/t/nodesnotavailable-for-java-client/68011/11 "2016-12-05T12:24:20Z")

</div>

great to see it working, thanks for posting the solution as well!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 2, 2017, 12:24pm UTC](https://discuss.elastic.co/t/nodesnotavailable-for-java-client/68011/12 "2017-01-02T12:24:25Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
