# NoNodeAvailableException\[None of the configured nodes are available: \[{#transport#-1}{DzxzK0iPRpWhbsQrG1XL-Q}{localhost}{127.0.0.1:9200}\]\]

**URL:** <https://discuss.elastic.co/t/nonodeavailableexception-none-of-the-configured-nodes-are-available-transport-1-dzxzk0iprpwhbsqrg1xl-q-localhost-127-0-0-1-9200/164625>\
**Category:** Elasticsearch\
**Created:** [January 17, 2019, 12:04pm UTC](https://discuss.elastic.co/t/nonodeavailableexception-none-of-the-configured-nodes-are-available-transport-1-dzxzk0iprpwhbsqrg1xl-q-localhost-127-0-0-1-9200/164625 "2019-01-17T12:04:48Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sajawal\_Sohail](https://avatars.discourse-cdn.com/v4/letter/s/a88e57/32.png) [@Sajawal\_Sohail](https://discuss.elastic.co/u/Sajawal_Sohail)\
**Post date:** [January 17, 2019, 12:04pm UTC](https://discuss.elastic.co/t/nonodeavailableexception-none-of-the-configured-nodes-are-available-transport-1-dzxzk0iprpwhbsqrg1xl-q-localhost-127-0-0-1-9200/164625/1 "2019-01-17T12:04:48Z")

</div>

I am facing this error while implementing elastic search in spring boot.

```
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loaders': Invocation of init method failed; nested exception is NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{FzaWEy4gQTeGXw04FAe5HQ}{127.0.0.1}{127.0.0.1:9200}]]

```

Here is the command im running

```
docker run -d -p 9200:9200 --name elasticsearch_test docker.elastic.co/elasticsearch/elasticsearch:6.5.4 elasticsearch -Enetwork.publish_host="localhost" -Etransport.publish_port="9200"

```

Here is node Log

```
{
"_nodes": {
    "total": 1,
    "successful": 1,
    "failed": 0
},
"cluster_name": "docker-cluster",
"nodes": {
    "-R2MlL29RdOzYYiAzKkrBQ": {
        "name": "-R2MlL2",
        "transport_address": "127.0.0.1:9200",
        "host": "localhost",
        "ip": "127.0.0.1",
        "version": "6.5.4",
        "build_flavor": "default",
        "build_type": "tar",
        "build_hash": "d2ef93d",
        "roles": [
            "master",
            "data",
            "ingest"
        ],
        "attributes": {
            "ml.machine_memory": "2076532736",
            "xpack.installed": "true",
            "ml.max_open_jobs": "20",
            "ml.enabled": "true"
        },
        "http": {
            "bound_address": [
                "0.0.0.0:9200"
            ],
            "publish_address": "127.0.0.1:9200",
            "max_content_length_in_bytes": 104857600
        }
    }
}

```

}

Here is my Configurations code

```
public TransportClient client() throws UnknownHostException{
    final Settings esSettings = Settings.builder().put("cluster.name", "docker-cluster").build();
    client = new PreBuiltTransportClient(esSettings);
    client.addTransportAddress(new TransportAddress(InetAddress.getByName("127.0.0.1"), 9200));

    return client;

}

```

And here is the Error point

```
public void loadAll() throws UnknownHostException {
    TransportClient client = esconf.client();
    ElasticsearchTemplate esTemplate = new ElasticsearchTemplate(client);
    esTemplate.createIndex("testindex");
}

```

Error is at the point where im creating index.

I have been through alot of links but no help.  
Any help will be appreciated. Thanks

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 17, 2019, 1:43pm UTC](https://discuss.elastic.co/t/nonodeavailableexception-none-of-the-configured-nodes-are-available-transport-1-dzxzk0iprpwhbsqrg1xl-q-localhost-127-0-0-1-9200/164625/2 "2019-01-17T13:43:16Z")

</div>

Why did you change the transport port. Keep the default one to 9300 and expose it from docker.

---

<div class="post-metadata">

**Author:** ![Sajawal\_Sohail](https://avatars.discourse-cdn.com/v4/letter/s/a88e57/32.png) [@Sajawal\_Sohail](https://discuss.elastic.co/u/Sajawal_Sohail)\
**Post date:** [January 18, 2019, 6:12am UTC](https://discuss.elastic.co/t/nonodeavailableexception-none-of-the-configured-nodes-are-available-transport-1-dzxzk0iprpwhbsqrg1xl-q-localhost-127-0-0-1-9200/164625/3 "2019-01-18T06:12:07Z")

</div>

Thanks for the reply David.  
I have tried on 9300 aswell but had no luck with it. Here is my other command with 9300

```
docker run -d -p 9200:9200 --name elasticsearch6 docker.elastic.co/elasticsearch/elasticsearch:6.5.4 elasticsearch -Enetwork.publish_host="localhost" -Etransport.publish_port="9300"
```

---

<div class="post-metadata">

**Author:** ![wenpos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wenpos/32/15326_2.png) [@wenpos](https://discuss.elastic.co/u/wenpos)\
**Post date:** [January 18, 2019, 6:15am UTC](https://discuss.elastic.co/t/nonodeavailableexception-none-of-the-configured-nodes-are-available-transport-1-dzxzk0iprpwhbsqrg1xl-q-localhost-127-0-0-1-9200/164625/4 "2019-01-18T06:15:01Z")

</div>

transport port is default 9300 while use TransportClient

---

<div class="post-metadata">

**Author:** ![Sajawal\_Sohail](https://avatars.discourse-cdn.com/v4/letter/s/a88e57/32.png) [@Sajawal\_Sohail](https://discuss.elastic.co/u/Sajawal_Sohail)\
**Post date:** [January 18, 2019, 6:19am UTC](https://discuss.elastic.co/t/nonodeavailableexception-none-of-the-configured-nodes-are-available-transport-1-dzxzk0iprpwhbsqrg1xl-q-localhost-127-0-0-1-9200/164625/5 "2019-01-18T06:19:29Z")

</div>

Fanfan, Yes I have tried 9300 aswell in transport client

```
TransportClient client = new PreBuiltTransportClient(Settings.EMPTY);
    client.addTransportAddress(new TransportAddress(InetAddress.getByName("localhost"), 9300));
```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 18, 2019, 8:49am UTC](https://discuss.elastic.co/t/nonodeavailableexception-none-of-the-configured-nodes-are-available-transport-1-dzxzk0iprpwhbsqrg1xl-q-localhost-127-0-0-1-9200/164625/6 "2019-01-18T08:49:35Z")

</div>

Try:

```auto
docker run -d -p 9200:9200 -p 9300:9300 --name elasticsearch6 docker.elastic.co/elasticsearch/elasticsearch:6.5.4 elasticsearch"

```

---

<div class="post-metadata">

**Author:** ![Sajawal\_Sohail](https://avatars.discourse-cdn.com/v4/letter/s/a88e57/32.png) [@Sajawal\_Sohail](https://discuss.elastic.co/u/Sajawal_Sohail)\
**Post date:** [January 18, 2019, 10:21am UTC](https://discuss.elastic.co/t/nonodeavailableexception-none-of-the-configured-nodes-are-available-transport-1-dzxzk0iprpwhbsqrg1xl-q-localhost-127-0-0-1-9200/164625/7 "2019-01-18T10:21:54Z")

</div>

David,  
I ran your command but unfortunately still getting the same error. Also my Node log has changes its IP now. Here is the updated node log

```
{
"_nodes": {
    "total": 1,
    "successful": 1,
    "failed": 0
},
"cluster_name": "docker-cluster",
"nodes": {
    "FwtsGvITR5q9-3hHnfu8yA": {
        "name": "FwtsGvI",
        "transport_address": "172.17.0.2:9300",
        "host": "172.17.0.2",
        "ip": "172.17.0.2",
        "version": "6.5.4",
        "build_flavor": "default",
        "build_type": "tar",
        "build_hash": "d2ef93d",
        "roles": [
            "master",
            "data",
            "ingest"
        ],
        "attributes": {
            "ml.machine_memory": "2076532736",
            "xpack.installed": "true",
            "ml.max_open_jobs": "20",
            "ml.enabled": "true"
        },
        "http": {
            "bound_address": [
                "0.0.0.0:9200"
            ],
            "publish_address": "172.17.0.2:9200",
            "max_content_length_in_bytes": 104857600
        }
    }
}

```

}

So i Updated my configurations to

```
client = new PreBuiltTransportClient(Settings.EMPTY);
    client.addTransportAddress(new TransportAddress(InetAddress.getByName("172.17.0.2"), 9300));
```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 18, 2019, 11:17am UTC](https://discuss.elastic.co/t/nonodeavailableexception-none-of-the-configured-nodes-are-available-transport-1-dzxzk0iprpwhbsqrg1xl-q-localhost-127-0-0-1-9200/164625/8 "2019-01-18T11:17:59Z")

</div>

Can you try:

```auto
client = new PreBuiltTransportClient(Settings.EMPTY);
    client.addTransportAddress(new TransportAddress(InetAddress.getByName("localhost"), 9300));

```

---

<div class="post-metadata">

**Author:** ![Sajawal\_Sohail](https://avatars.discourse-cdn.com/v4/letter/s/a88e57/32.png) [@Sajawal\_Sohail](https://discuss.elastic.co/u/Sajawal_Sohail)\
**Post date:** [January 18, 2019, 11:21am UTC](https://discuss.elastic.co/t/nonodeavailableexception-none-of-the-configured-nodes-are-available-transport-1-dzxzk0iprpwhbsqrg1xl-q-localhost-127-0-0-1-9200/164625/9 "2019-01-18T11:21:54Z")

</div>

Had no luck with "localhost" aswell. Here is the error log

```
2019-01-18 16:19:00.015 WARN 18860 --- [main] o.e.c.t.TransportClientNodesService : node {#transport#-1}{9Rg1pf0mQ9K-g4ItyTrK7A}{localhost}{127.0.0.1:9300} not part of the cluster Cluster [elasticsearch], ignoring...
2019-01-18 16:19:00.017 WARN 18860 --- [main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loaders': Invocation of init method failed; nested exception is NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{9Rg1pf0mQ9K-g4ItyTrK7A}{localhost}{127.0.0.1:9300}]]
```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 18, 2019, 11:35am UTC](https://discuss.elastic.co/t/nonodeavailableexception-none-of-the-configured-nodes-are-available-transport-1-dzxzk0iprpwhbsqrg1xl-q-localhost-127-0-0-1-9200/164625/10 "2019-01-18T11:35:00Z")

</div>

Much better though... `not part of the cluster Cluster [elasticsearch]`

As your cluster name is `docker-cluster` you can not use `Settings.EMPTY` but

```auto
client = new PreBuiltTransportClient(Settings.builder().put("cluster.name", "docker-cluster").build());

```

---

<div class="post-metadata">

**Author:** ![Sajawal\_Sohail](https://avatars.discourse-cdn.com/v4/letter/s/a88e57/32.png) [@Sajawal\_Sohail](https://discuss.elastic.co/u/Sajawal_Sohail)\
**Post date:** [January 18, 2019, 11:41am UTC](https://discuss.elastic.co/t/nonodeavailableexception-none-of-the-configured-nodes-are-available-transport-1-dzxzk0iprpwhbsqrg1xl-q-localhost-127-0-0-1-9200/164625/11 "2019-01-18T11:41:36Z")

</div>

Thanks for the help Sir.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 18, 2019, 12:48pm UTC](https://discuss.elastic.co/t/nonodeavailableexception-none-of-the-configured-nodes-are-available-transport-1-dzxzk0iprpwhbsqrg1xl-q-localhost-127-0-0-1-9200/164625/12 "2019-01-18T12:48:03Z")

</div>

You're welcome.  
I want to add that you should use the rest client instead.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 15, 2019, 12:48pm UTC](https://discuss.elastic.co/t/nonodeavailableexception-none-of-the-configured-nodes-are-available-transport-1-dzxzk0iprpwhbsqrg1xl-q-localhost-127-0-0-1-9200/164625/13 "2019-02-15T12:48:04Z")

</div>

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