Transport Client - NoNodeAvailableException[None of the configured nodes are available]

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}{}]]
at org.elasticsearch.client.transport.TransportClientNodesService.ensureNodesAreAvailable(
at org.elasticsearch.client.transport.TransportClientNodesService.execute(
at org.elasticsearch.client.transport.TransportProxyClient.execute(
at org.elasticsearch.client.transport.TransportClient.doExecute(
at org.elasticsearch.action.ActionRequestBuilder.execute(
at org.elasticsearch.action.ActionRequestBuilder.execute(
at org.elasticsearch.action.ActionRequestBuilder.get(
at org.young.App.main(

I follow the document to write the following java code:

Settings settings = Settings.builder()
                .put("", "elasticsearch")
                .put("client.transport.sniff", true)
        TransportClient client = new PreBuiltTransportClient(settings)
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.

"_nodes": {
"total": 1,
"successful": 1,
"failed": 0
"cluster_name": "elasticsearch",
"nodes": {
"tc29L00fSAWX4_SdbvWbSQ": {
"name": "tc29L00",
"transport_address": "",
"host": "",
"ip": "",
"version": "5.4.3",
"build_hash": "eed30a8",
"total_indexing_buffer": 213005107,
"roles": [
"settings": {
"client": {
"type": "node"
"cluster": {
"name": "elasticsearch"
"http": {
"host": "",
"type": {
"default": "netty4"
"node": {
"name": "tc29L00"
"path": {
"logs": "/usr/share/elasticsearch/logs",
"home": "/usr/share/elasticsearch"
"transport": {
"type": {
"default": "netty4"

1 Like

Dear All

I solved the issue.
I used the docker image to run the elastic search.

The command on this page:

docker run -p 9200:9200 -e "" -e ""

-e "" did not work.

I have to change the elasticsearch.yml, uncomment this line:

So that the transport client can correctly connect to port 9300.

Found another issue if I turned on

.put("client.transport.sniff", true)

It will cause the same error. I need to remove this line in my setting configuration.


This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.