Java client creation failure


(thealy) #1

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.
For more options, visit https://groups.google.com/groups/opt_out.


(Jörg Prante) #2

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.
For more options, visit https://groups.google.com/groups/opt_out.


(thealy) #3

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.
For more options, visit https://groups.google.com/groups/opt_out.


(thealy) #4

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.
For more options, visit https://groups.google.com/groups/opt_out.


(system) #5