I downloaded Elasticsearch 5.0.0-beta1. I am trying to add documents through JAVA API.
I always get exception when trying to run.
Elasticsearch configuration
cluster.name: cluster_hostname
node.name: node_venkatesh
network.host : ${HOSTNAME}
http.port: 9500
transport.tcp.port: 9700
script.engine.groovy.inline.aggs: on
script.engine.groovy.inline.update: on
JAVA API Configuration
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.client.Client;
Settings settings = null;
Client client = null;
this.settings = Settings.settingsBuilder()
.put("cluster.name", "cluster_hostname")
.put("client.transport.sniff", true)
.put("node.name", "node_venkatesh")
.put("transport.tcp.port", 9700).build();
this.client = TransportClient.builder().settings(settings).build().addTransportAddress(
new InetSocketTransportAddress(InetAddress.getByName("HOSTNAME"), 9700));
Output when client is started
Sep 23, 2016 1:44:42 PM org.elasticsearch.plugins.PluginsService <init>
INFO: [node_venkatesh] modules [], plugins [], sites []
Sep 23, 2016 1:44:43 PM org.elasticsearch.client.transport.TransportClientNodesService$SniffNodesSampler$1$1 handleException
INFO: [node_venkatesh] failed to get local cluster state for {#transport#-1}{192.168.***.***}{HOSTNAME/192.168.***.***}, disconnecting...
NodeDisconnectedException[[][HOSTNAME/192.168.***.***:9700][cluster:monitor/state] disconnected]
Exception while running code
Exception in thread "main" NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{192.168.***.***}{HOSTNAME/192.168.***.***:9700}]]
at org.elasticsearch.client.transport.TransportClientNodesService.ensureNodesAreAvailable(TransportClientNodesService.java:290)
at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:207)
at org.elasticsearch.client.transport.support.TransportProxyClient.execute(TransportProxyClient.java:55)
at org.elasticsearch.client.transport.TransportClient.doExecute(TransportClient.java:288)
at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:359)
at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:86)
at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:56)
at org.elasticsearch.action.ActionRequestBuilder.get(ActionRequestBuilder.java:64)
This configuration and code is perfectly working with elasticsearch-2.3.3 .
Kindly help.