# Node not available Exception when using GClient (wrapping TransportClient)

**URL:** <https://discuss.elastic.co/t/node-not-available-exception-when-using-gclient-wrapping-transportclient/12503>\
**Category:** Elasticsearch\
**Created:** [June 21, 2013, 6:20am UTC](https://discuss.elastic.co/t/node-not-available-exception-when-using-gclient-wrapping-transportclient/12503 "2013-06-21T06:20:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Donny\_A\_Wijaya](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/donny_a_wijaya/32/2265_2.png) [@Donny\_A\_Wijaya](https://discuss.elastic.co/u/Donny_A_Wijaya)\
**Post date:** [June 21, 2013, 6:20am UTC](https://discuss.elastic.co/t/node-not-available-exception-when-using-gclient-wrapping-transportclient/12503/1 "2013-06-21T06:20:49Z")

</div>

Hi,

I'm experiencing "No node available exception" when I use GClient that is  
created by wrapping a configured TransportClient.

def settings = ImmutableSettings.settingsBuilder()  
def client = new TransportClient(settings)

client.addTransportAddress(new InetSocketTransportAddress('localhost', 9200  
))

def gClient = new GClient(client)

gClient.index {  
index "test"  
type "type1"  
id "1"  
source {  
test = "value"  
complex {  
value1 = "value1"  
value2 = "value2"  
}  
}  
}

It works fine if I create the GClient using GNodeBuilder. But the code  
would be difficult to maintain.  
So I'm trying to wrap it inside a Grails Plugin. What I want to achive is  
to use the same GClient instance across multiple modules.

Is there any better way of doing this?

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [June 21, 2013, 6:28am UTC](https://discuss.elastic.co/t/node-not-available-exception-when-using-gclient-wrapping-transportclient/12503/2 "2013-06-21T06:28:20Z")

</div>

Don't forget to set the same cluster name.

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 21 juin 2013 à 08:20, "Donny A. Wijaya" [slickwolf@gmail.com](mailto:slickwolf@gmail.com) a écrit :

> Hi,
> 
> I'm experiencing "No node available exception" when I use GClient that is created by wrapping a configured TransportClient.
> 
> def settings = ImmutableSettings.settingsBuilder()  
> def client = new TransportClient(settings)
> 
> client.addTransportAddress(new InetSocketTransportAddress('localhost', 9200))
> 
> def gClient = new GClient(client)
> 
> gClient.index {  
> index "test"  
> type "type1"  
> id "1"  
> source {  
> test = "value"  
> complex {  
> value1 = "value1"  
> value2 = "value2"  
> }  
> }  
> }
> 
> It works fine if I create the GClient using GNodeBuilder. But the code would be difficult to maintain.  
> So I'm trying to wrap it inside a Grails Plugin. What I want to achive is to use the same GClient instance across multiple modules.
> 
> ## Is there any better way of doing this?
> 
> 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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Donny\_A\_Wijaya](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/donny_a_wijaya/32/2265_2.png) [@Donny\_A\_Wijaya](https://discuss.elastic.co/u/Donny_A_Wijaya)\
**Post date:** [June 21, 2013, 7:22am UTC](https://discuss.elastic.co/t/node-not-available-exception-when-using-gclient-wrapping-transportclient/12503/3 "2013-06-21T07:22:52Z")

</div>

Hi David,

Thanks for the reply.

I just set the "cluster.name" settings to "elasticsearch"

(Note: I have the elasticsearch service running on my local on port 9200  
with the cluster.name configured to "elasticsearch"):

def settings = ImmutableSettings.settingsBuilder()  
.put("cluster.name", "elasticsearch")  
.build()

But it still throws the same Exception.

Thanks,

Donny

On Friday, June 21, 2013 2:28:20 PM UTC+8, David Pilato wrote:

> Don't forget to set the same cluster name.
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 21 juin 2013 à 08:20, "Donny A. Wijaya" \<[slic...@gmail.com](mailto:slic...@gmail.com)\<javascript:\>\>  
> a écrit :
> 
> Hi,
> 
> I'm experiencing "No node available exception" when I use GClient that is  
> created by wrapping a configured TransportClient.
> 
> def settings = ImmutableSettings.settingsBuilder()  
> def client = new TransportClient(settings)
> 
> client.addTransportAddress(new InetSocketTransportAddress('localhost',  
> 9200))
> 
> def gClient = new GClient(client)
> 
> gClient.index {  
> index "test"  
> type "type1"  
> id "1"  
> source {  
> test = "value"  
> complex {  
> value1 = "value1"  
> value2 = "value2"  
> }  
> }  
> }
> 
> It works fine if I create the GClient using GNodeBuilder. But the code  
> would be difficult to maintain.  
> So I'm trying to wrap it inside a Grails Plugin. What I want to achive is  
> to use the same GClient instance across multiple modules.
> 
> Is there any better way of doing this?
> 
> --  
> 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [June 21, 2013, 7:27am UTC](https://discuss.elastic.co/t/node-not-available-exception-when-using-gclient-wrapping-transportclient/12503/4 "2013-06-21T07:27:59Z")

</div>

Ok. So your cluster is using default cluster name. Adding cluster.name won't help here.  
I only pointed that because it's a really common mistake most of us are doing…

## Found it! Rereading your conf. Use 9300 and not 9200 port!

David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 21 juin 2013 à 09:22, "Donny A. Wijaya" [slickwolf@gmail.com](mailto:slickwolf@gmail.com) a écrit :

> Hi David,
> 
> Thanks for the reply.
> 
> I just set the "cluster.name" settings to "elasticsearch"
> 
> (Note: I have the elasticsearch service running on my local on port 9200 with the cluster.name configured to "elasticsearch"):
> 
> def settings = ImmutableSettings.settingsBuilder()  
> .put("cluster.name", "elasticsearch")  
> .build()
> 
> But it still throws the same Exception.
> 
> Thanks,
> 
> Donny
> 
> On Friday, June 21, 2013 2:28:20 PM UTC+8, David Pilato wrote:  
> Don't forget to set the same cluster name.
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 21 juin 2013 à 08:20, "Donny A. Wijaya" [slic...@gmail.com](mailto:slic...@gmail.com) a écrit :
> 
> > Hi,
> > 
> > I'm experiencing "No node available exception" when I use GClient that is created by wrapping a configured TransportClient.
> > 
> > def settings = ImmutableSettings.settingsBuilder()  
> > def client = new TransportClient(settings)
> > 
> > client.addTransportAddress(new InetSocketTransportAddress('localhost', 9200))
> > 
> > def gClient = new GClient(client)
> > 
> > gClient.index {  
> > index "test"  
> > type "type1"  
> > id "1"  
> > source {  
> > test = "value"  
> > complex {  
> > value1 = "value1"  
> > value2 = "value2"  
> > }  
> > }  
> > }
> > 
> > It works fine if I create the GClient using GNodeBuilder. But the code would be difficult to maintain.  
> > So I'm trying to wrap it inside a Grails Plugin. What I want to achive is to use the same GClient instance across multiple modules.
> > 
> > Is there any better way of doing this?
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> 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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Donny\_A\_Wijaya](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/donny_a_wijaya/32/2265_2.png) [@Donny\_A\_Wijaya](https://discuss.elastic.co/u/Donny_A_Wijaya)\
**Post date:** [June 21, 2013, 7:31am UTC](https://discuss.elastic.co/t/node-not-available-exception-when-using-gclient-wrapping-transportclient/12503/5 "2013-06-21T07:31:01Z")

</div>

Hi David,

You're right!! My mistake!!

Thank you very much!!

Donny

On Friday, June 21, 2013 3:27:59 PM UTC+8, David Pilato wrote:

> Ok. So your cluster is using default cluster name. Adding cluster.namewon't help here.  
> I only pointed that because it's a really common mistake most of us are  
> doing…
> 
> ## Found it! Rereading your conf. Use 9300 and not 9200 port!
> 
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)  
> | @scrutmydocs [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> 
> Le 21 juin 2013 à 09:22, "Donny A. Wijaya" \<[slic...@gmail.com](mailto:slic...@gmail.com)\<javascript:\>\>  
> a écrit :
> 
> Hi David,
> 
> Thanks for the reply.
> 
> I just set the "cluster.name" settings to "elasticsearch"
> 
> (Note: I have the elasticsearch service running on my local on port 9200  
> with the cluster.name configured to "elasticsearch"):
> 
> def settings = ImmutableSettings.settingsBuilder()  
> .put("cluster.name", "elasticsearch")  
> .build()
> 
> But it still throws the same Exception.
> 
> Thanks,
> 
> Donny
> 
> On Friday, June 21, 2013 2:28:20 PM UTC+8, David Pilato wrote:
> 
> > Don't forget to set the same cluster name.
> > 
> > --  
> > David 😉  
> > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > 
> > Le 21 juin 2013 à 08:20, "Donny A. Wijaya" [slic...@gmail.com](mailto:slic...@gmail.com) a écrit :
> > 
> > Hi,
> > 
> > I'm experiencing "No node available exception" when I use GClient that is  
> > created by wrapping a configured TransportClient.
> > 
> > def settings = ImmutableSettings.settingsBuilder()  
> > def client = new TransportClient(settings)
> > 
> > client.addTransportAddress(new InetSocketTransportAddress('localhost',  
> > 9200))
> > 
> > def gClient = new GClient(client)
> > 
> > gClient.index {  
> > index "test"  
> > type "type1"  
> > id "1"  
> > source {  
> > test = "value"  
> > complex {  
> > value1 = "value1"  
> > value2 = "value2"  
> > }  
> > }  
> > }
> > 
> > It works fine if I create the GClient using GNodeBuilder. But the code  
> > would be difficult to maintain.  
> > So I'm trying to wrap it inside a Grails Plugin. What I want to achive is  
> > to use the same GClient instance across multiple modules.
> > 
> > Is there any better way of doing this?
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:30am UTC](https://discuss.elastic.co/t/node-not-available-exception-when-using-gclient-wrapping-transportclient/12503/6 "2017-07-06T02:30:04Z")

</div>


