# NoNodeAvailableException error

**URL:** <https://discuss.elastic.co/t/nonodeavailableexception-error/228871>\
**Category:** Elasticsearch\
**Created:** [April 20, 2020, 1:19pm UTC](https://discuss.elastic.co/t/nonodeavailableexception-error/228871 "2020-04-20T13:19:25Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Siddharth1010](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@Siddharth1010](https://discuss.elastic.co/u/Siddharth1010)\
**Post date:** [April 20, 2020, 1:19pm UTC](https://discuss.elastic.co/t/nonodeavailableexception-error/228871/1 "2020-04-20T13:19:25Z")

</div>

I am trying to save data in elasticsearch database through REST API using SpringBoot.I am using the following in my application.yml file

```auto
  data:
    elasticsearch:
      username: xxxxx
      password: xxxxx
      host: xxxxx
      node-name: xxxxx
      cluster-name: xxxx
      cluster-nodes: localhost:9300
      client:
        transport:
          ignore_cluster_name: true

```

I am keeping the Config File blank

On running the project I am getting the following logs

```auto
main org.elasticsearch.client.transport.TransportClientNodesService - {} - node {#transport#-1}{m-Y19jlaSfOhQNkqjzzDaw}{localhost}{127.0.0.1:9300} not part of the cluster Cluster [xxxxxx], ignoring...
[2020-04-20 18:42:14,881] ERROR failed to load elasticsearch nodes : org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: [{#transport#-1}{m-Y19jlaSfOhQNkqjzzDaw}{localhost}{127.0.0.1:9300}] (org.springframework.data.elasticsearch.repository.support.AbstractElasticsearchRepository:91)
[INFO] 2020-04-20 18:42:15,476 main org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor - {} - Initializing ExecutorService 'applicationTaskExecutor'
Apr 20, 2020 6:42:16 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-8080"]
[INFO] 2020-04-20 18:42:16,094 main org.springframework.boot.web.embedded.tomcat.TomcatWebServer - {} - Tomcat started on port(s): 8080 (http) with context path ''
[INFO] 2020-04-20 18:42:16,098 main com.target.ejtricklearchiverks.Main - {} - Started Main in 5.014 seconds (JVM running for 5.708)
[WARN] 2020-04-20 18:42:19,475 elasticsearch[_client_][generic][T#2] org.elasticsearch.client.transport.TransportClientNodesService - {} - node {#transport#-1}{m-Y19jlaSfOhQNkqjzzDaw}{localhost}{127.0.0.1:9300} not part of the cluster Cluster [xxxxxxx], ignoring...
[WARN] 2020-04-20 18:42:24,496 elasticsearch[_client_][generic][T#1] org.elasticsearch.client.transport.TransportClientNodesService - {} - node {#transport#-1}{m-Y19jlaSfOhQNkqjzzDaw}{localhost}{127.0.0.1:9300} not part of the cluster Cluster [xxxxxxx], ignoring...

```

Can anyone please help with this error

---

<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:** [April 20, 2020, 2:44pm UTC](https://discuss.elastic.co/t/nonodeavailableexception-error/228871/2 "2020-04-20T14:44:10Z")

</div>

Few comments:

> [@Siddharth1010](#):
>
> I am trying to save data in elasticsearch database through REST API

Sure. But you are using the deprecated TransportClient here which is not using the REST Layer (9200) but the Transport Layer (9300).

You should switch to the rest client instead. I guess you are using spring data elasticsearch, so have a look at their documentation on how to switch to the REST Client.

---

<div class="post-metadata">

**Author:** ![Siddharth1010](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@Siddharth1010](https://discuss.elastic.co/u/Siddharth1010)\
**Post date:** [April 20, 2020, 4:04pm UTC](https://discuss.elastic.co/t/nonodeavailableexception-error/228871/3 "2020-04-20T16:04:41Z")

</div>

Can you please provide the link to the documentation

---

<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:** [April 20, 2020, 4:22pm UTC](https://discuss.elastic.co/t/nonodeavailableexception-error/228871/4 "2020-04-20T16:22:53Z")

</div>

A simple google search drove me to [https://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/#elasticsearch.clients.rest](https://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/#elasticsearch.clients.rest)

---

<div class="post-metadata">

**Author:** ![Siddharth1010](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@Siddharth1010](https://discuss.elastic.co/u/Siddharth1010)\
**Post date:** [April 21, 2020, 12:27pm UTC](https://discuss.elastic.co/t/nonodeavailableexception-error/228871/5 "2020-04-21T12:27:33Z")

</div>

I will not be able to use REST Client as some part of the code fetches data through kafka which would make it very slow. Is there any other alterenartive ?

---

<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:** [April 21, 2020, 1:03pm UTC](https://discuss.elastic.co/t/nonodeavailableexception-error/228871/6 "2020-04-21T13:03:21Z")

</div>

> [@Siddharth1010](#):
>
> which would make it very slow.

Why do you think so?

---

<div class="post-metadata">

**Author:** ![Siddharth1010](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@Siddharth1010](https://discuss.elastic.co/u/Siddharth1010)\
**Post date:** [April 21, 2020, 1:12pm UTC](https://discuss.elastic.co/t/nonodeavailableexception-error/228871/7 "2020-04-21T13:12:34Z")

</div>

I am able to save the data on elasticsearch version locally which runs on localhost:9200 but not on the database on my companies server. My code is what it was at the beginning and I am getting the error while only while using the database in my companie's server.

Is it because it may have a different transport client instead of 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:** [April 21, 2020, 1:43pm UTC](https://discuss.elastic.co/t/nonodeavailableexception-error/228871/8 "2020-04-21T13:43:16Z")

</div>

That's not the same question. Why do you think it will be slow which prevents you using the REST Client?

---

<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:** [May 19, 2020, 1:43pm UTC](https://discuss.elastic.co/t/nonodeavailableexception-error/228871/9 "2020-05-19T13:43:19Z")

</div>

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