Dear Sir
I got the following error message when I tried to use transport client:
Exception in thread "main" NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{zSavWRA4QBGzdYdox-h2Aw}{localhost}{127.0.0.1:9300}]]
at org.elasticsearch.client.transport.TransportClientNodesService.ensureNodesAreAvailable(TransportClientNodesService.java:348)
at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:246)
at org.elasticsearch.client.transport.TransportProxyClient.execute(TransportProxyClient.java:59)
at org.elasticsearch.client.transport.TransportClient.doExecute(TransportClient.java:366)
at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:408)
at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:80)
at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:54)
at org.elasticsearch.action.ActionRequestBuilder.get(ActionRequestBuilder.java:62)
at org.young.App.main(App.java:58)
I follow the document to write the following java code:
Settings settings = Settings.builder()
.put("cluster.name", "elasticsearch")
.put("client.transport.sniff", true)
.build();
TransportClient client = new PreBuiltTransportClient(settings)
.addTransportAddress(new
InetSocketTransportAddress(InetAddress.getByName("localhost"), 9300));
From the Kibana console GET _nodes/_all, I can see the nodes information in the end of attachment. I am sure the client java version and server side version are the same. Also, the port number, clustername, and host are correct.
Could you give me more hints to solve this issue?
Thank you so much.
Young
{
"_nodes": {
"total": 1,
"successful": 1,
"failed": 0
},
"cluster_name": "elasticsearch",
"nodes": {
"tc29L00fSAWX4_SdbvWbSQ": {
"name": "tc29L00",
"transport_address": "127.0.0.1:9300",
"host": "127.0.0.1",
"ip": "127.0.0.1",
"version": "5.4.3",
"build_hash": "eed30a8",
"total_indexing_buffer": 213005107,
"roles": [
"master",
"data",
"ingest"
],
"settings": {
"client": {
"type": "node"
},
"cluster": {
"name": "elasticsearch"
},
"http": {
"host": "0.0.0.0",
"type": {
"default": "netty4"
}
},
"node": {
"name": "tc29L00"
},
"path": {
"logs": "/usr/share/elasticsearch/logs",
"home": "/usr/share/elasticsearch"
},
"transport": {
"type": {
"default": "netty4"
}
}
},