# Java client creation failure

**URL:** <https://discuss.elastic.co/t/java-client-creation-failure/13837>\
**Category:** Elasticsearch\
**Created:** [October 3, 2013, 6:24pm UTC](https://discuss.elastic.co/t/java-client-creation-failure/13837 "2013-10-03T18:24:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![thealy](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@thealy](https://discuss.elastic.co/u/thealy)\
**Post date:** [October 3, 2013, 6:24pm UTC](https://discuss.elastic.co/t/java-client-creation-failure/13837/1 "2013-10-03T18:24:02Z")

</div>

I'm running version 0.90.3 on a 6 node ES cluster. My first Java API based  
program to index log entries from a file works fine. So I'm trying to morph  
it to run via TCP socket connection to accept "live" feeds via Redis. The  
program is running on the same workstation - which is one of the cluster  
nodes. I am using this code, which works fine in the file-based app:

```
    // Try to get ES node connection
    try {
        
        node = 

```

nodeBuilder().client(true).clusterName(elasticCluster).node();  
client = node.client();

```
    } catch (Exception ex) {....

```

But when I attempt to create the client, I get this error:

13/10/03 14:10:57 INFO elasticsearch.node: [t5] version[0.90.3], pid[6505],  
build[5c38d60/2013-08-06T13:18:31Z]  
13/10/03 14:10:57 INFO elasticsearch.node: [t5] initializing ...  
13/10/03 14:10:57 INFO elasticsearch.plugins: [t5] loaded [], sites [head]  
13/10/03 14:10:59 ERROR state.meta: [t5] failed to read local state,  
exiting...  
org.elasticsearch.ElasticSearchIllegalStateException: node is not  
configured to store local location

All searching for a cause/solution seem to refer to something called  
"graylog" (which I am not using), and none  
of them have an answer.

Any suggestions?

Thanks

--  
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:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [October 3, 2013, 6:38pm UTC](https://discuss.elastic.co/t/java-client-creation-failure/13837/2 "2013-10-03T18:38:39Z")

</div>

Just a quick helper

- you use NodeClient (there is also TransportClient which in my eyes is  
simpler to use)
- a NodeClient uses cluster discovery behind the scenes
- because a NodeClient is a full member of the cluster, it must be able to  
read and save cluster state via local gateway
- in your example, there is no setting for configuration of the path for  
the local gateway, so the default settings apply
- your node client wants to synchronize with the cluster by sending its own  
state, but can't read a previously saved state, which is fatal, and then it  
bails out

Jörg

--  
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:** ![thealy](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@thealy](https://discuss.elastic.co/u/thealy)\
**Post date:** [October 3, 2013, 6:48pm UTC](https://discuss.elastic.co/t/java-client-creation-failure/13837/3 "2013-10-03T18:48:29Z")

</div>

Thank you for all the info Jorg. I'm not sure I understand it all, but will  
switch to TransportClient and see how that goes. I'm still confused that  
the file-based program works, but the environment must somehow be different.

Terry

On Thursday, October 3, 2013 2:38:39 PM UTC-4, Jörg Prante wrote:

> Just a quick helper
> 
> - you use NodeClient (there is also TransportClient which in my eyes is  
> simpler to use)
> - a NodeClient uses cluster discovery behind the scenes
> - because a NodeClient is a full member of the cluster, it must be able to  
> read and save cluster state via local gateway
> - in your example, there is no setting for configuration of the path for  
> the local gateway, so the default settings apply
> - your node client wants to synchronize with the cluster by sending its  
> own state, but can't read a previously saved state, which is fatal, and  
> then it bails out
> 
> Jörg

--  
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:** ![thealy](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@thealy](https://discuss.elastic.co/u/thealy)\
**Post date:** [October 3, 2013, 7:27pm UTC](https://discuss.elastic.co/t/java-client-creation-failure/13837/4 "2013-10-03T19:27:23Z")

</div>

TransportClient worked like a charm - thanks Jorg.

On Thursday, October 3, 2013 2:48:29 PM UTC-4, Terry Healy wrote:

> Thank you for all the info Jorg. I'm not sure I understand it all, but  
> will switch to TransportClient and see how that goes. I'm still confused  
> that the file-based program works, but the environment must somehow be  
> different.
> 
> Terry
> 
> On Thursday, October 3, 2013 2:38:39 PM UTC-4, Jörg Prante wrote:
> 
> > Just a quick helper
> > 
> > - you use NodeClient (there is also TransportClient which in my eyes is  
> > simpler to use)
> > - a NodeClient uses cluster discovery behind the scenes
> > - because a NodeClient is a full member of the cluster, it must be able  
> > to read and save cluster state via local gateway
> > - in your example, there is no setting for configuration of the path for  
> > the local gateway, so the default settings apply
> > - your node client wants to synchronize with the cluster by sending its  
> > own state, but can't read a previously saved state, which is fatal, and  
> > then it bails out
> > 
> > Jörg

--  
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:13am UTC](https://discuss.elastic.co/t/java-client-creation-failure/13837/5 "2017-07-06T02:13:53Z")

</div>


