Skip to content

Instantly share code, notes, and snippets.

@andrewclegg
Created June 26, 2012 12:48
Show Gist options
  • Save andrewclegg/2995620 to your computer and use it in GitHub Desktop.
Save andrewclegg/2995620 to your computer and use it in GitHub Desktop.
failed to get local cluster state
When I do this:
protected Client newClient() {
final Settings settings = ImmutableSettings.settingsBuilder().build();
final TransportClient client = new TransportClient(settings);
client.addTransportAddress(new InetSocketTransportAddress("localhost", 9200));
return client;
}
I get this:
Jun 26, 2012 1:46:38 PM com.pearson.entech.rodeo.agents.CountAgent <init>
INFO: Trying to instantiate ElasticSearch client
12/06/26 13:46:38 INFO elasticsearch.plugins: [Lang, Cassie] loaded [], sites []
12/06/26 13:46:44 INFO client.transport: [Lang, Cassie] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9200]], disconnecting...
org.elasticsearch.transport.ReceiveTimeoutTransportException: [][inet[localhost/127.0.0.1:9200]][cluster/nodes/info] request_id [0] timed out after [5000ms]
at org.elasticsearch.transport.TransportService$TimeoutHandler.run(TransportService.java:347)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
But I can send requests via curl to localhost:9200 without any problems.
@andrewclegg
Copy link
Author

If anyone else gets this: change the port to 9300, that's the transport client's direct TCP port. 9200 is just for HTTP.

@ornicar
Copy link

ornicar commented Sep 3, 2012

I owe you one, dude. Thanks.

@yogidevendra
Copy link

I faced the same problem.
Thanks for the precise fix.

@anselmo
Copy link

anselmo commented Jun 2, 2016

Top!

@xhcom-ui
Copy link

Is there a solution? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment