# X-pack PreBuiltXPackTransportClient occurs NoNodeAvailableException

**URL:** <https://discuss.elastic.co/t/x-pack-prebuiltxpacktransportclient-occurs-nonodeavailableexception/73999>\
**Category:** Elasticsearch\
**Created:** [February 6, 2017, 12:13am UTC](https://discuss.elastic.co/t/x-pack-prebuiltxpacktransportclient-occurs-nonodeavailableexception/73999 "2017-02-06T00:13:04Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![lks21c](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lks21c/32/15218_2.png) [@lks21c](https://discuss.elastic.co/u/lks21c)\
**Post date:** [February 6, 2017, 12:13am UTC](https://discuss.elastic.co/t/x-pack-prebuiltxpacktransportclient-occurs-nonodeavailableexception/73999/1 "2017-02-06T00:13:04Z")

</div>

Hi, I'm using ES 5.1.1 with Kibana 5.1.1.

I planned to setup x-pack on both ES and Kibana to use authentication.

What I've configured setting is below.

========================  
  
org.elasticsearch.client  
x-pack-transport  
5.1.1

# TransportClient client = new PreBuiltXPackTransportClient(Settings.builder() .put("[cluster.name](http://cluster.name)", ES\_CLUSTER\_NAME) .put("xpack.security.user", "elastic:@password") .put("xpack.security.transport.ssl.enabled", "false") .build()) .addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(ES\_HOST), ES\_PORT));

But I got below exception even though I had tried to catch my potential mistake after reading this post 3 times.  
[https://www.elastic.co/guide/en/x-pack/5.1/java-clients.html](https://www.elastic.co/guide/en/x-pack/5.1/java-clients.html)

NoNodeAvailableException[None of the configured nodes are available:

On the other hand, Kibana and CURL was successful with default 9200 port.  
Also, transportclient works well after removing x-pack on ES to make sure my connection info.

Can anybody help me out to resolve this issue?

Thanks for reading this.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 6, 2017, 5:40am UTC](https://discuss.elastic.co/t/x-pack-prebuiltxpacktransportclient-occurs-nonodeavailableexception/73999/2 "2017-02-06T05:40:16Z")

</div>

Note that ES\_PORT must be 9300.

---

<div class="post-metadata">

**Author:** ![lks21c](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lks21c/32/15218_2.png) [@lks21c](https://discuss.elastic.co/u/lks21c)\
**Post date:** [February 6, 2017, 6:47am UTC](https://discuss.elastic.co/t/x-pack-prebuiltxpacktransportclient-occurs-nonodeavailableexception/73999/3 "2017-02-06T06:47:06Z")

</div>

@dadoonet, Thanks for the replay.

I did set the port to 9300 which is a default port for TransportService.

However, the message occured like above.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 6, 2017, 7:16am UTC](https://discuss.elastic.co/t/x-pack-prebuiltxpacktransportclient-occurs-nonodeavailableexception/73999/4 "2017-02-06T07:16:06Z")

</div>

May be share your elasticsearch logs so we are sure you bound the network host.

---

<div class="post-metadata">

**Author:** ![lks21c](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lks21c/32/15218_2.png) [@lks21c](https://discuss.elastic.co/u/lks21c)\
**Post date:** [February 6, 2017, 11:49am UTC](https://discuss.elastic.co/t/x-pack-prebuiltxpacktransportclient-occurs-nonodeavailableexception/73999/5 "2017-02-06T11:49:48Z")

</div>

@dadoonet  
Here's what I got after trying to connect to my ES with transport port(9300).  
I masked my dns and ip info.

NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{OGuljAe5SvuFwB\_b0G56lQ}{DNS}{IP:9300}]  
]  
at org.elasticsearch.client.transport.TransportClientNodesService.ensureNodesAreAvailable(TransportClientNodesService.java:328)  
at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:226)  
at org.elasticsearch.client.transport.TransportProxyClient.execute(TransportProxyClient.java:59)  
at org.elasticsearch.client.transport.TransportClient.doExecute(TransportClient.java:345)  
at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:403)  
at org.elasticsearch.client.FilterClient.doExecute(FilterClient.java:67)  
at org.elasticsearch.client.support.AbstractClient$1.doExecute(AbstractClient.java:1754)  
at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:403)  
at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:80)  
at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:54)  
at org.elasticsearch.action.ActionRequestBuilder.get(ActionRequestBuilder.java:62)  
at com.creamsugardonut.etc.EsTest.test1(EsTest.java:54)  
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)  
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
at java.lang.reflect.Method.invoke(Method.java:498)  
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)  
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)  
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)  
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)  
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)  
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)  
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)  
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)  
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)  
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)  
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)  
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)  
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)  
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)  
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)  
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)  
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:51)  
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:237)  
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)  
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)  
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
at java.lang.reflect.Method.invoke(Method.java:498)  
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 6, 2017, 4:42pm UTC](https://discuss.elastic.co/t/x-pack-prebuiltxpacktransportclient-occurs-nonodeavailableexception/73999/6 "2017-02-06T16:42:32Z")

</div>

But can you share your elasticsearch logs?

Make sure that port 9300 is opened,

---

<div class="post-metadata">

**Author:** ![lks21c](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lks21c/32/15218_2.png) [@lks21c](https://discuss.elastic.co/u/lks21c)\
**Post date:** [February 6, 2017, 11:52pm UTC](https://discuss.elastic.co/t/x-pack-prebuiltxpacktransportclient-occurs-nonodeavailableexception/73999/7 "2017-02-06T23:52:51Z")

</div>

This is my es log.

As I mentioned earlier, I already verified transport port and cluster name are correct by removing x-pack plugin and connecting successfully.

[2017-02-07T08:49:48,409][INFO][o.e.n.Node] [] initializing ...  
[2017-02-07T08:49:48,472][INFO][o.e.e.NodeEnvironment] [v46nvy3] using [1] data paths, mounts [[/ (/dev/sda7)]], net usable\_space [51.3gb], net total\_space [83.9gb], spins? [no], types [ext4]  
[2017-02-07T08:49:48,473][INFO][o.e.e.NodeEnvironment] [v46nvy3] heap size [1.9gb], compressed ordinary object pointers [true]  
[2017-02-07T08:49:48,474][INFO][o.e.n.Node] node name [v46nvy3] derived from node ID [v46nvy3ITcSs62FewBiJlw]; set [[node.name](http://node.name)] to override  
[2017-02-07T08:49:48,475][INFO][o.e.n.Node] version[5.1.1], pid[25472], build[5395e21/2016-12-06T12:36:15.409Z], OS[Linux/4.4.0-62-generic/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0\_121/25.121-b13]  
[2017-02-07T08:49:49,824][INFO][o.e.p.PluginsService] [v46nvy3] loaded module [aggs-matrix-stats]  
[2017-02-07T08:49:49,824][INFO][o.e.p.PluginsService] [v46nvy3] loaded module [ingest-common]  
[2017-02-07T08:49:49,824][INFO][o.e.p.PluginsService] [v46nvy3] loaded module [lang-expression]  
[2017-02-07T08:49:49,824][INFO][o.e.p.PluginsService] [v46nvy3] loaded module [lang-groovy]  
[2017-02-07T08:49:49,824][INFO][o.e.p.PluginsService] [v46nvy3] loaded module [lang-mustache]  
[2017-02-07T08:49:49,824][INFO][o.e.p.PluginsService] [v46nvy3] loaded module [lang-painless]  
[2017-02-07T08:49:49,824][INFO][o.e.p.PluginsService] [v46nvy3] loaded module [percolator]  
[2017-02-07T08:49:49,825][INFO][o.e.p.PluginsService] [v46nvy3] loaded module [reindex]  
[2017-02-07T08:49:49,825][INFO][o.e.p.PluginsService] [v46nvy3] loaded module [transport-netty3]  
[2017-02-07T08:49:49,825][INFO][o.e.p.PluginsService] [v46nvy3] loaded module [transport-netty4]  
[2017-02-07T08:49:49,825][INFO][o.e.p.PluginsService] [v46nvy3] loaded plugin [elasticsearch-analysis-mecab-ko]  
[2017-02-07T08:49:49,825][INFO][o.e.p.PluginsService] [v46nvy3] loaded plugin [lang-javascript]  
[2017-02-07T08:49:49,826][INFO][o.e.p.PluginsService] [v46nvy3] loaded plugin [x-pack]  
[2017-02-07T08:49:50,135][INFO][o.e.s.ScriptService] [v46nvy3] compiling script file [/home/lks21c/elasticsearch-5.1.1/config/scripts/my\_script.groovy]  
[2017-02-07T08:49:52,425][INFO][o.e.n.Node] initialized  
[2017-02-07T08:49:52,425][INFO][o.e.n.Node] [v46nvy3] starting ...  
[2017-02-07T08:49:52,652][INFO][o.e.t.TransportService] [v46nvy3] publish\_address {192.168.43.55:9300}, bound\_addresses {[::]:9300}  
[2017-02-07T08:49:52,657][INFO][o.e.b.BootstrapCheck] [v46nvy3] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks  
[2017-02-07T08:49:55,818][INFO][o.e.c.s.ClusterService] [v46nvy3] new\_master {v46nvy3}{v46nvy3ITcSs62FewBiJlw}{N7H5GCPnQbS7v57ikHcFkQ}{192.168.43.55}{192.168.43.55:9300}, reason: zen-disco-elected-as-master ([0] nodes joined)  
[2017-02-07T08:49:55,832][INFO][o.e.h.HttpServer] [v46nvy3] publish\_address {192.168.43.55:9200}, bound\_addresses {[::]:9200}  
[2017-02-07T08:49:55,833][INFO][o.e.n.Node] [v46nvy3] started  
[2017-02-07T08:49:55,936][INFO][o.e.g.GatewayService] [v46nvy3] recovered [0] indices into cluster\_state

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 7, 2017, 4:53am UTC](https://discuss.elastic.co/t/x-pack-prebuiltxpacktransportclient-occurs-nonodeavailableexception/73999/8 "2017-02-07T04:53:54Z")

</div>

So ES\_HOST is 192.168.43.55 and port is 9300 in your code?  
Or anything else?

---

<div class="post-metadata">

**Author:** ![lks21c](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lks21c/32/15218_2.png) [@lks21c](https://discuss.elastic.co/u/lks21c)\
**Post date:** [February 7, 2017, 5:46am UTC](https://discuss.elastic.co/t/x-pack-prebuiltxpacktransportclient-occurs-nonodeavailableexception/73999/9 "2017-02-07T05:46:00Z")

</div>

@dadoonet

I'm very sorry for my mistake.

It was caused by Junit's ES Client was set differently.

Again, I'm very sorry to waste your time.

I carefully looked into client configuration and set it correctly and worked well.  
Thanks for the reply.

---

<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:** [March 7, 2017, 5:46am UTC](https://discuss.elastic.co/t/x-pack-prebuiltxpacktransportclient-occurs-nonodeavailableexception/73999/10 "2017-03-07T05:46:19Z")

</div>

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