# NodeBuilder.local(true) question

**URL:** <https://discuss.elastic.co/t/nodebuilder-local-true-question/5985>\
**Category:** Elasticsearch\
**Created:** [November 27, 2011, 8:27pm UTC](https://discuss.elastic.co/t/nodebuilder-local-true-question/5985 "2011-11-27T20:27:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ridvan\_Gyundogan](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@Ridvan\_Gyundogan](https://discuss.elastic.co/u/Ridvan_Gyundogan)\
**Post date:** [November 27, 2011, 8:27pm UTC](https://discuss.elastic.co/t/nodebuilder-local-true-question/5985/1 "2011-11-27T20:27:39Z")

</div>

Hi All,  
can someone give me a hint how to fix the following junit test:

> <https://gist.github.com/anonymous/1398083>

I try to connect to a local node, but I always get "No node available  
exception".

---

<div class="post-metadata">

**Author:** ![Lukas\_Vlcek1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas_vlcek1/32/819_2.png) [@Lukas\_Vlcek1](https://discuss.elastic.co/u/Lukas_Vlcek1)\
**Post date:** [November 27, 2011, 9:36pm UTC](https://discuss.elastic.co/t/nodebuilder-local-true-question/5985/2 "2011-11-27T21:36:04Z")

</div>

Hi,

when using local node there is no access point exposed to the public. In  
other words you can not use TransportClient to connect to a node that is  
running locally.

Either use local(false) [I can not recommend this for unit test] or get  
client from node using node.client() [I would say that is the way to go for unit tests].

Regards,  
Lukas

On Sun, Nov 27, 2011 at 9:27 PM, Ridvan Gyundogan [ridvansg@gmail.com](mailto:ridvansg@gmail.com)wrote:

> Hi All,  
> can someone give me a hint how to fix the following junit test:  
> [JUnit test connecting to local ES node · GitHub](https://gist.github.com/1398083)
> 
> I try to connect to a local node, but I always get "No node available  
> exception".

---

<div class="post-metadata">

**Author:** ![Ridvan\_Gyundogan](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@Ridvan\_Gyundogan](https://discuss.elastic.co/u/Ridvan_Gyundogan)\
**Post date:** [November 28, 2011, 10:09am UTC](https://discuss.elastic.co/t/nodebuilder-local-true-question/5985/3 "2011-11-28T10:09:57Z")

</div>

Thanks very very much Lukas, will try with node.client(); .

On Nov 27, 11:36 pm, Lukáš Vlček [lukas.vl...@gmail.com](mailto:lukas.vl...@gmail.com) wrote:

> Hi,
> 
> when using local node there is no access point exposed to the public. In  
> other words you can not use TransportClient to connect to a node that is  
> running locally.
> 
> Either use local(false) [I can not recommend this for unit test] or get  
> client from node using node.client() [I would say that is the way to go for unit tests].
> 
> Regards,  
> Lukas
> 
> On Sun, Nov 27, 2011 at 9:27 PM, Ridvan Gyundogan [ridva...@gmail.com](mailto:ridva...@gmail.com)wrote:
> 
> > Hi All,  
> > can someone give me a hint how to fix the following junit test:  
> > [JUnit test connecting to local ES node · GitHub](https://gist.github.com/1398083)
> 
> > I try to connect to a local node, but I always get "No node available  
> > exception".

---

<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, 3:47am UTC](https://discuss.elastic.co/t/nodebuilder-local-true-question/5985/4 "2017-07-06T03:47:21Z")

</div>


