# Newbie question for TransportClient

**URL:** https://discuss.elastic.co/t/newbie-question-for-transportclient/2898
**Category:** Elasticsearch
**Created:** [April 8, 2010, 7:05am UTC](https://discuss.elastic.co/t/newbie-question-for-transportclient/2898 "2010-04-08T07:05:02Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![sezgin\_kucukkaraasla](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@sezgin\_kucukkaraasla](https://discuss.elastic.co/u/sezgin_kucukkaraasla)
#### Post date: [April 8, 2010, 7:05am UTC](https://discuss.elastic.co/t/newbie-question-for-transportclient/2898/1 "2010-04-08T07:05:02Z")

</div>

Hi,  
We have been using Compass and Grails Searchable Plugin for some time  
to  
store our product data. Now we are evaluating Elastic Search and treat  
it as  
an external system for the first phase. I'm using ElasticSearch 0.5.1  
release, and trying to connect to a node in the local machine with  
TransportClient. When I execute the following code I got "No node  
available  
exception".

System.setProperty("java.net.preferIPv4Stack", "true");  
TransportClient client = new TransportClient();  
client.addTransportAddress(new  
InetSocketTransportAddress("192.168.1.102",  
9300));

ClusterHealthRequest healthRequest = new ClusterHealthRequest();  
ClusterHealthResponse response =  
client.admin().cluster().health(healthRequest).actionGet();

client.close();

Here is the exception trace:

Exception in thread "main"  
org.elasticsearch.client.transport.NoNodeAvailableException: No node  
available  
at  
org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:  
129)  
at  
org.elasticsearch.client.transport.support.InternalTransportClusterAdminClient.health(InternalTransportClusterAdminClient.java:  
84)

I got the same exception with other actions except "health". But when  
I open  
a browser and request the cluster health I got the response properly.

{"status":"green","timedOut":false,"activePrimaryShards":  
0,"activeShards":0,"relocatingShards":0}

Here is my local node configuration:

network:  
bindHost: 192.168.1.102  
publishHost: 192.168.1.102  
cluster:  
name: snmpCluster  
discovery:  
jgroups:  
config: tcp  
bind\_addr: 192.168.1.102  
tcpping:  
initial\_hosts: 192.168.1.102[7800]

Is there something that I'm doing wrong?

Thanks in advance,

Sezgin Kucukkaraaslan  
[www.ifountain.com](http://www.ifountain.com)

---

<div class="post-metadata">

### Author: ![HubertChang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hubertchang/32/3352_2.png) [@HubertChang](https://discuss.elastic.co/u/HubertChang)
#### Post date: [April 8, 2010, 8:02am UTC](https://discuss.elastic.co/t/newbie-question-for-transportclient/2898/2 "2010-04-08T08:02:17Z")

</div>

I am working on an elasticsearch plugin for grails. [github.com/hz/grails-elasticsearch](http://github.com/hz/grails-elasticsearch). I use the embedded server to connect to elasticsearch.

---

<div class="post-metadata">

### Author: ![sezgin\_kucukkaraasla](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@sezgin\_kucukkaraasla](https://discuss.elastic.co/u/sezgin_kucukkaraasla)
#### Post date: [April 8, 2010, 11:21am UTC](https://discuss.elastic.co/t/newbie-question-for-transportclient/2898/3 "2010-04-08T11:21:40Z")

</div>

That's great news. First I've tried the embedded server version but I  
had some classpath problems with the Compass version that we are  
using. (we already have older lucene jars in our classpath). So I  
decided to go on with TransportClient for the time being.

On Apr 8, 11:02 am, HubertChang [hui...@gmail.com](mailto:hui...@gmail.com) wrote:

> ## I am working on an elasticsearch plugin for grails. [github.com/hz/grails-elasticsearch](http://github.com/hz/grails-elasticsearch). I use the embedded server to connect to elasticsearch.
> 
> View this message in context:[http://n3.nabble.com/Newbie-question-for-TransportClient-tp705234p705](http://n3.nabble.com/Newbie-question-for-TransportClient-tp705234p705)...  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

### Author: ![dominict](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dominict/32/3351_2.png) [@dominict](https://discuss.elastic.co/u/dominict)
#### Post date: [April 8, 2010, 12:16pm UTC](https://discuss.elastic.co/t/newbie-question-for-transportclient/2898/4 "2010-04-08T12:16:54Z")

</div>

When you start the node what does it say in the logs for what the  
transport is listening on?

i.e.  
[13:14:11,726][INFO][transport] [Matador]  
boundAddress [inet[/0.0.0.0:9300]], publishAddress [inet[/  
10.0.1.2:9300]]

for the above I'd have:

client.addTransportAddress(new InetSocketTransportAddress("0.0.0.0",  
9300));

or

client.addTransportAddress(new InetSocketTransportAddress("10.0.1.2",  
9300));

See if your api settings differ to what the server is listening on.

/dom

On Apr 8, 12:21 pm, "sezgin.kucukkaraaslan" [sezo...@gmail.com](mailto:sezo...@gmail.com) wrote:

> That's great news. First I've tried the embedded server version but I  
> had some classpath problems with the Compass version that we are  
> using. (we already have older lucene jars in our classpath). So I  
> decided to go on with TransportClient for the time being.
> 
> On Apr 8, 11:02 am, HubertChang [hui...@gmail.com](mailto:hui...@gmail.com) wrote:
> 
> > ## I am working on an elasticsearch plugin for grails. [github.com/hz/grails-elasticsearch](http://github.com/hz/grails-elasticsearch). I use the embedded server to connect to elasticsearch.
> > 
> > View this message in context:[http://n3.nabble.com/Newbie-question-for-TransportClient-tp705234p705](http://n3.nabble.com/Newbie-question-for-TransportClient-tp705234p705)...  
> > Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

### Author: ![sezgin\_kucukkaraasla](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@sezgin\_kucukkaraasla](https://discuss.elastic.co/u/sezgin_kucukkaraasla)
#### Post date: [April 8, 2010, 12:25pm UTC](https://discuss.elastic.co/t/newbie-question-for-transportclient/2898/5 "2010-04-08T12:25:11Z")

</div>

It says:

[transport] [Gill, Donald "Donny"] boundAddress  
[inet[/192.168.1.102:9300]], publishAddress  
[inet[/192.168.1.102:9300[http://10.0.1.2:9300/](http://10.0.1.2:9300/)  
]]

as I provide for the transport address.

On Thu, Apr 8, 2010 at 3:16 PM, dominict [dominic.tootell@gmail.com](mailto:dominic.tootell@gmail.com) wrote:

> When you start the node what does it say in the logs for what the  
> transport is listening on?
> 
> i.e.  
> [13:14:11,726][INFO][transport] [Matador]  
> boundAddress [inet[/0.0.0.0:9300]], publishAddress [inet[/  
> 10.0.1.2:9300]]
> 
> for the above I'd have:
> 
> client.addTransportAddress(new InetSocketTransportAddress("0.0.0.0",  
> 9300));
> 
> or
> 
> client.addTransportAddress(new InetSocketTransportAddress("10.0.1.2",  
> 9300));
> 
> See if your api settings differ to what the server is listening on.
> 
> /dom
> 
> On Apr 8, 12:21 pm, "sezgin.kucukkaraaslan" [sezo...@gmail.com](mailto:sezo...@gmail.com) wrote:
> 
> > That's great news. First I've tried the embedded server version but I  
> > had some classpath problems with the Compass version that we are  
> > using. (we already have older lucene jars in our classpath). So I  
> > decided to go on with TransportClient for the time being.
> > 
> > On Apr 8, 11:02 am, HubertChang [hui...@gmail.com](mailto:hui...@gmail.com) wrote:
> > 
> > > ## I am working on an elasticsearch plugin for grails. [github.com/hz/grails-elasticsearch](http://github.com/hz/grails-elasticsearch). I use the embedded server to connect to elasticsearch.
> > > 
> > > View this message in context:  
> > > [http://n3.nabble.com/Newbie-question-for-TransportClient-tp705234p705](http://n3.nabble.com/Newbie-question-for-TransportClient-tp705234p705)...  
> > > Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

### Author: ![dominict](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dominict/32/3351_2.png) [@dominict](https://discuss.elastic.co/u/dominict)
#### Post date: [April 8, 2010, 12:48pm UTC](https://discuss.elastic.co/t/newbie-question-for-transportclient/2898/6 "2010-04-08T12:48:18Z")

</div>

I had a tinker here.  
remove this bit from your config (not sure why, but just give it a  
go... ):

cluster:  
name: snmpCluster

/dom

On Apr 8, 1:25 pm, sezgin küçükkaraaslan [sezo...@gmail.com](mailto:sezo...@gmail.com) wrote:

> It says:
> 
> [transport] [Gill, Donald "Donny"] boundAddress  
> [inet[/192.168.1.102:9300]], publishAddress  
> [inet[/192.168.1.102:9300[http://10.0.1.2:9300/](http://10.0.1.2:9300/)  
> ]]
> 
> as I provide for the transport address.
> 
> On Thu, Apr 8, 2010 at 3:16 PM, dominict [dominic.toot...@gmail.com](mailto:dominic.toot...@gmail.com) wrote:
> 
> > When you start the node what does it say in the logs for what the  
> > transport is listening on?
> 
> > i.e.  
> > [13:14:11,726][INFO][transport] [Matador]  
> > boundAddress [inet[/0.0.0.0:9300]], publishAddress [inet[/  
> > 10.0.1.2:9300]]
> 
> > for the above I'd have:
> 
> > client.addTransportAddress(new InetSocketTransportAddress("0.0.0.0",  
> > 9300));
> 
> > or
> 
> > client.addTransportAddress(new InetSocketTransportAddress("10.0.1.2",  
> > 9300));
> 
> > See if your api settings differ to what the server is listening on.
> 
> > /dom
> 
> > On Apr 8, 12:21 pm, "sezgin.kucukkaraaslan" [sezo...@gmail.com](mailto:sezo...@gmail.com) wrote:
> > 
> > > That's great news. First I've tried the embedded server version but I  
> > > had some classpath problems with the Compass version that we are  
> > > using. (we already have older lucene jars in our classpath). So I  
> > > decided to go on with TransportClient for the time being.
> 
> > > On Apr 8, 11:02 am, HubertChang [hui...@gmail.com](mailto:hui...@gmail.com) wrote:
> 
> > > > ## I am working on an elasticsearch plugin for grails. [github.com/hz/grails-elasticsearch](http://github.com/hz/grails-elasticsearch). I use the embedded server to connect to elasticsearch.
> > > > 
> > > > View this message in context:  
> > > > [http://n3.nabble.com/Newbie-question-for-TransportClient-tp705234p705](http://n3.nabble.com/Newbie-question-for-TransportClient-tp705234p705)...  
> > > > Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

### Author: ![dominict](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dominict/32/3351_2.png) [@dominict](https://discuss.elastic.co/u/dominict)
#### Post date: [April 8, 2010, 12:54pm UTC](https://discuss.elastic.co/t/newbie-question-for-transportclient/2898/7 "2010-04-08T12:54:56Z")

</div>

If you want the TransportClient to work with you clusterName  
"snmpCluster". Create the transport client as follows:

Map\<String,String\> m = new HashMap\<String,String\>();  
m.put("cluster.name","snmpCluster");  
Settings s = ImmutableSettings.settingsBuilder() .put(m).build();

TransportClient client = new TransportClient(s);

cheers,  
/dom

On Apr 8, 1:48 pm, dominict [dominic.toot...@gmail.com](mailto:dominic.toot...@gmail.com) wrote:

> I had a tinker here.  
> remove this bit from your config (not sure why, but just give it a  
> go... ):
> 
> cluster:  
> name: snmpCluster
> 
> /dom
> 
> On Apr 8, 1:25 pm, sezgin küçükkaraaslan [sezo...@gmail.com](mailto:sezo...@gmail.com) wrote:
> 
> > It says:
> 
> > [transport] [Gill, Donald "Donny"] boundAddress  
> > [inet[/192.168.1.102:9300]], publishAddress  
> > [inet[/192.168.1.102:9300[http://10.0.1.2:9300/](http://10.0.1.2:9300/)  
> > ]]
> 
> > as I provide for the transport address.
> 
> > On Thu, Apr 8, 2010 at 3:16 PM, dominict [dominic.toot...@gmail.com](mailto:dominic.toot...@gmail.com) wrote:
> > 
> > > When you start the node what does it say in the logs for what the  
> > > transport is listening on?
> 
> > > i.e.  
> > > [13:14:11,726][INFO][transport] [Matador]  
> > > boundAddress [inet[/0.0.0.0:9300]], publishAddress [inet[/  
> > > 10.0.1.2:9300]]
> 
> > > for the above I'd have:
> 
> > > client.addTransportAddress(new InetSocketTransportAddress("0.0.0.0",  
> > > 9300));
> 
> > > or
> 
> > > client.addTransportAddress(new InetSocketTransportAddress("10.0.1.2",  
> > > 9300));
> 
> > > See if your api settings differ to what the server is listening on.
> 
> > > /dom
> 
> > > On Apr 8, 12:21 pm, "sezgin.kucukkaraaslan" [sezo...@gmail.com](mailto:sezo...@gmail.com) wrote:
> > > 
> > > > That's great news. First I've tried the embedded server version but I  
> > > > had some classpath problems with the Compass version that we are  
> > > > using. (we already have older lucene jars in our classpath). So I  
> > > > decided to go on with TransportClient for the time being.
> 
> > > > On Apr 8, 11:02 am, HubertChang [hui...@gmail.com](mailto:hui...@gmail.com) wrote:
> 
> > > > > ## I am working on an elasticsearch plugin for grails. [github.com/hz/grails-elasticsearch](http://github.com/hz/grails-elasticsearch). I use the embedded server to connect to elasticsearch.
> > > > > 
> > > > > View this message in context:  
> > > > > [http://n3.nabble.com/Newbie-question-for-TransportClient-tp705234p705](http://n3.nabble.com/Newbie-question-for-TransportClient-tp705234p705)...  
> > > > > Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

### Author: ![sezgin\_kucukkaraasla](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@sezgin\_kucukkaraasla](https://discuss.elastic.co/u/sezgin_kucukkaraasla)
#### Post date: [April 8, 2010, 2:39pm UTC](https://discuss.elastic.co/t/newbie-question-for-transportclient/2898/8 "2010-04-08T14:39:42Z")

</div>

Bingo !! That works fine, thank you very much.

Sezgin Kucukkaraaslan  
[www.ifountain.com](http://www.ifountain.com)

On Thu, Apr 8, 2010 at 3:54 PM, dominict [dominic.tootell@gmail.com](mailto:dominic.tootell@gmail.com) wrote:

> If you want the TransportClient to work with you clusterName  
> "snmpCluster". Create the transport client as follows:
> 
> Map\<String,String\> m = new HashMap\<String,String\>();  
> m.put("cluster.name","snmpCluster");  
> Settings s = ImmutableSettings.settingsBuilder() .put(m).build();
> 
> TransportClient client = new TransportClient(s);
> 
> cheers,  
> /dom
> 
> On Apr 8, 1:48 pm, dominict [dominic.toot...@gmail.com](mailto:dominic.toot...@gmail.com) wrote:
> 
> > I had a tinker here.  
> > remove this bit from your config (not sure why, but just give it a  
> > go... ):
> > 
> > cluster:  
> > name: snmpCluster
> > 
> > /dom
> > 
> > On Apr 8, 1:25 pm, sezgin küçükkaraaslan [sezo...@gmail.com](mailto:sezo...@gmail.com) wrote:
> > 
> > > It says:
> > 
> > > [transport] [Gill, Donald "Donny"] boundAddress  
> > > [inet[/192.168.1.102:9300]], publishAddress  
> > > [inet[/192.168.1.102:9300[http://10.0.1.2:9300/](http://10.0.1.2:9300/)  
> > > ]]
> > 
> > > as I provide for the transport address.
> > 
> > > On Thu, Apr 8, 2010 at 3:16 PM, dominict [dominic.toot...@gmail.com](mailto:dominic.toot...@gmail.com)  
> > > wrote:
> > > 
> > > > When you start the node what does it say in the logs for what the  
> > > > transport is listening on?
> > 
> > > > i.e.  
> > > > [13:14:11,726][INFO][transport] [Matador]  
> > > > boundAddress [inet[/0.0.0.0:9300]], publishAddress [inet[/  
> > > > 10.0.1.2:9300]]
> > 
> > > > for the above I'd have:
> > 
> > > > client.addTransportAddress(new InetSocketTransportAddress("0.0.0.0",  
> > > > 9300));
> > 
> > > > or
> > 
> > > > client.addTransportAddress(new InetSocketTransportAddress("10.0.1.2",  
> > > > 9300));
> > 
> > > > See if your api settings differ to what the server is listening on.
> > 
> > > > /dom
> > 
> > > > On Apr 8, 12:21 pm, "sezgin.kucukkaraaslan" [sezo...@gmail.com](mailto:sezo...@gmail.com)  
> > > > wrote:
> > > > 
> > > > > That's great news. First I've tried the embedded server version but  
> > > > > I  
> > > > > had some classpath problems with the Compass version that we are  
> > > > > using. (we already have older lucene jars in our classpath). So I  
> > > > > decided to go on with TransportClient for the time being.
> > 
> > > > > On Apr 8, 11:02 am, HubertChang [hui...@gmail.com](mailto:hui...@gmail.com) wrote:
> > 
> > > > > > ## I am working on an elasticsearch plugin for grails. [github.com/hz/grails-elasticsearch](http://github.com/hz/grails-elasticsearch). I use the embedded server to connect to elasticsearch.
> > > > > > 
> > > > > > View this message in context:
> 
> [http://n3.nabble.com/Newbie-question-for-TransportClient-tp705234p705](http://n3.nabble.com/Newbie-question-for-TransportClient-tp705234p705)...
> 
> > > > > > Sent from the Elasticsearch Users mailing list archive at  
> > > > > > [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

### Author: ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)
#### Post date: [April 8, 2010, 2:43pm UTC](https://discuss.elastic.co/t/newbie-question-for-transportclient/2898/9 "2010-04-08T14:43:55Z")

</div>

Hi,

Good catch!. The transport client automatically filters out nodes that do  
not belong to the cluster. The cluster is defined by the cluster name.

cheers,  
shay.banon

2010/4/8 sezgin küçükkaraaslan [sezo104@gmail.com](mailto:sezo104@gmail.com)

> Bingo !! That works fine, thank you very much.
> 
> Sezgin Kucukkaraaslan  
> [www.ifountain.com](http://www.ifountain.com)
> 
> On Thu, Apr 8, 2010 at 3:54 PM, dominict [dominic.tootell@gmail.com](mailto:dominic.tootell@gmail.com)wrote:
> 
> > If you want the TransportClient to work with you clusterName  
> > "snmpCluster". Create the transport client as follows:
> > 
> > Map\<String,String\> m = new HashMap\<String,String\>();  
> > m.put("cluster.name","snmpCluster");  
> > Settings s = ImmutableSettings.settingsBuilder() .put(m).build();
> > 
> > TransportClient client = new TransportClient(s);
> > 
> > cheers,  
> > /dom
> > 
> > On Apr 8, 1:48 pm, dominict [dominic.toot...@gmail.com](mailto:dominic.toot...@gmail.com) wrote:
> > 
> > > I had a tinker here.  
> > > remove this bit from your config (not sure why, but just give it a  
> > > go... ):
> > > 
> > > cluster:  
> > > name: snmpCluster
> > > 
> > > /dom
> > > 
> > > On Apr 8, 1:25 pm, sezgin küçükkaraaslan [sezo...@gmail.com](mailto:sezo...@gmail.com) wrote:
> > > 
> > > > It says:
> > > 
> > > > [transport] [Gill, Donald "Donny"] boundAddress  
> > > > [inet[/192.168.1.102:9300]], publishAddress  
> > > > [inet[/192.168.1.102:9300[http://10.0.1.2:9300/](http://10.0.1.2:9300/)  
> > > > ]]
> > > 
> > > > as I provide for the transport address.
> > > 
> > > > On Thu, Apr 8, 2010 at 3:16 PM, dominict [dominic.toot...@gmail.com](mailto:dominic.toot...@gmail.com)  
> > > > wrote:
> > > > 
> > > > > When you start the node what does it say in the logs for what the  
> > > > > transport is listening on?
> > > 
> > > > > i.e.  
> > > > > [13:14:11,726][INFO][transport] [Matador]  
> > > > > boundAddress [inet[/0.0.0.0:9300]], publishAddress [inet[/  
> > > > > 10.0.1.2:9300]]
> > > 
> > > > > for the above I'd have:
> > > 
> > > > > client.addTransportAddress(new InetSocketTransportAddress("0.0.0.0",  
> > > > > 9300));
> > > 
> > > > > or
> > > 
> > > > > client.addTransportAddress(new  
> > > > > InetSocketTransportAddress("10.0.1.2",  
> > > > > 9300));
> > > 
> > > > > See if your api settings differ to what the server is listening on.
> > > 
> > > > > /dom
> > > 
> > > > > On Apr 8, 12:21 pm, "sezgin.kucukkaraaslan" [sezo...@gmail.com](mailto:sezo...@gmail.com)  
> > > > > wrote:
> > > > > 
> > > > > > That's great news. First I've tried the embedded server version  
> > > > > > but I  
> > > > > > had some classpath problems with the Compass version that we are  
> > > > > > using. (we already have older lucene jars in our classpath). So I  
> > > > > > decided to go on with TransportClient for the time being.
> > > 
> > > > > > On Apr 8, 11:02 am, HubertChang [hui...@gmail.com](mailto:hui...@gmail.com) wrote:
> > > 
> > > > > > > ## I am working on an elasticsearch plugin for grails. [github.com/hz/grails-elasticsearch](http://github.com/hz/grails-elasticsearch). I use the embedded server to connect to elasticsearch.
> > > > > > > 
> > > > > > > View this message in context:
> > 
> > [http://n3.nabble.com/Newbie-question-for-TransportClient-tp705234p705](http://n3.nabble.com/Newbie-question-for-TransportClient-tp705234p705)...
> > 
> > > > > > > Sent from the Elasticsearch Users mailing list archive at  
> > > > > > > [Nabble.com](http://Nabble.com).

---

<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: [July 6, 2017, 4:24am UTC](https://discuss.elastic.co/t/newbie-question-for-transportclient/2898/10 "2017-07-06T04:24:46Z")

</div>


