I have elasticsearch running on Linux, and I write a simple test program on
Windows in Java.
The program is running well on Linux, while getting error on Windows, the
error message is:
Exception in thread "main"
org.elasticsearch.client.transport.NoNodeAvailableException: No node
available
- at
org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:205)* - at
org.elasticsearch.client.transport.support.InternalTransportClient.execute(InternalTransportClient.java:106)* - at
org.elasticsearch.client.support.AbstractClient.index(AbstractClient.java:82)* - at
org.elasticsearch.client.transport.TransportClient.index(TransportClient.java:320)* - at
org.elasticsearch.action.index.IndexRequestBuilder.doExecute(IndexRequestBuilder.java:314)* - at
org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:85)* - at
org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:59)* - at org.es.test.FirstTest.indexAndGet(FirstTest.java:36)*
- at org.es.test.FirstTest.main(FirstTest.java:58)*
- at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)*
- at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)* - at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)* - at java.lang.reflect.Method.invoke(Method.java:597)*
- at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)*
I checked for a long time, the version of JDK on Linux is 1.6.0_18, and on
Windows is : 1.6.0_39
Does the version of jdk make the difference? Thanks in advance.
*The test program is : *
Settings settings = ImmutableSettings.settingsBuilder().put("cluster.name",
"sohu-tv")
.put("node.name", "index-rank").build();
Client client = new TransportClient(settings).addTransportAddress(
new InetSocketTransportAddress("10.16.15.193", 9300));
try {
XContentBuilder builder = jsonBuilder()
.startObject()
.field("name", "daniel")
.field("age", 27)
.field("hobby", "basketball")
.endObject();
System.out.println(builder.string());
IndexResponse response = client.prepareIndex("corp", "employee", "4")
.setSource(builder).execute().actionGet();
String _index = response.getIndex();
String _type = response.getType();
String _id = response.getId();
long _version = response.getVersion();
--
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.