# NoNodeAvailableException\[None of the configured nodes are available: \[{#transport#-1}{IDKtOnPrQICBFDFU-dCxrw}{localhost}{127.0.0.1:9300}\] \]

**URL:** <https://discuss.elastic.co/t/nonodeavailableexception-none-of-the-configured-nodes-are-available-transport-1-idktonprqicbfdfu-dcxrw-localhost-127-0-0-1-9300/112334>\
**Category:** Elasticsearch\
**Created:** [December 19, 2017, 2:29am UTC](https://discuss.elastic.co/t/nonodeavailableexception-none-of-the-configured-nodes-are-available-transport-1-idktonprqicbfdfu-dcxrw-localhost-127-0-0-1-9300/112334 "2017-12-19T02:29:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jomalonejia](https://avatars.discourse-cdn.com/v4/letter/j/f17d59/32.png) [@jomalonejia](https://discuss.elastic.co/u/jomalonejia)\
**Post date:** [December 19, 2017, 2:29am UTC](https://discuss.elastic.co/t/nonodeavailableexception-none-of-the-configured-nodes-are-available-transport-1-idktonprqicbfdfu-dcxrw-localhost-127-0-0-1-9300/112334/1 "2017-12-19T02:29:46Z")

</div>

```
i run the es on docker , and it worked well

```

 ![1](https://us1.discourse-cdn.com/elastic/original/3X/5/3/53b711a6c645c598b6a174994b932fccccbd4887.PNG)

when i wanna use java client it throw exception:

`NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{fe2lzyyASMa7y-5slCY0rw}{localhost}{127.0.0.1:9300}]]`

this is my pom parts:

 ![2](https://us1.discourse-cdn.com/elastic/original/3X/2/2/22b31ef51c4ac9646604d22073a341ffc406d6bd.PNG)

and this is my code:  
@RunWith(SpringRunner.class)  
@SpringBootTest  
public class Test1ApplicationTests {

```
        private static TransportClient client;

        @Before
        public void before() {
            try {
                 client = new PreBuiltTransportClient(
                        Settings.builder().put("cluster.name", "elasticsearch").put("client.transport.sniff", true)
                        .build())
                         .addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("localhost"), 9300));
            } catch (UnknownHostException e) {
                e.printStackTrace();
            }
        }

        @Test
        public void CreateJSON() {

            String json = "{" +
                    "\"user\":\"kimchy\"," +
                    "\"postDate\":\"2013-01-30\"," +
                    "\"message\":\"trying out Elasticsearch\"" +
                    "}";
            IndexResponse response = client.prepareIndex("twitter", "tweet")
                    .setSource(json, XContentType.JSON)
                    .get();
            System.out.println(response.getResult());
        }
    }
```

---

<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:** [December 19, 2017, 6:52am UTC](https://discuss.elastic.co/t/nonodeavailableexception-none-of-the-configured-nodes-are-available-transport-1-idktonprqicbfdfu-dcxrw-localhost-127-0-0-1-9300/112334/2 "2017-12-19T06:52:10Z")

</div>

Please don't post images of text as they are hardly readable and not searchable.

Instead paste the text and format it with `</>` icon. Check the preview window.

Please format your code using `</>` icon as explained in [this guide](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). It will make your post more readable.

Or use markdown style like:

````
```
CODE
```
````

---

<div class="post-metadata">

**Author:** ![jomalonejia](https://avatars.discourse-cdn.com/v4/letter/j/f17d59/32.png) [@jomalonejia](https://discuss.elastic.co/u/jomalonejia)\
**Post date:** [December 29, 2017, 6:50am UTC](https://discuss.elastic.co/t/nonodeavailableexception-none-of-the-configured-nodes-are-available-transport-1-idktonprqicbfdfu-dcxrw-localhost-127-0-0-1-9300/112334/3 "2017-12-29T06:50:54Z")

</div>

i have solved this issue, it worked well when i override the default clustername,

---

<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:** [January 26, 2018, 6:50am UTC](https://discuss.elastic.co/t/nonodeavailableexception-none-of-the-configured-nodes-are-available-transport-1-idktonprqicbfdfu-dcxrw-localhost-127-0-0-1-9300/112334/4 "2018-01-26T06:50:56Z")

</div>

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