# Can't access 9300 port

**URL:** <https://discuss.elastic.co/t/cant-access-9300-port/179281>\
**Category:** Elasticsearch\
**Created:** [May 2, 2019, 5:59am UTC](https://discuss.elastic.co/t/cant-access-9300-port/179281 "2019-05-02T05:59:36Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![yyfdayin](https://avatars.discourse-cdn.com/v4/letter/y/34f0e0/32.png) [@yyfdayin](https://discuss.elastic.co/u/yyfdayin)\
**Post date:** [May 2, 2019, 5:59am UTC](https://discuss.elastic.co/t/cant-access-9300-port/179281/1 "2019-05-02T05:59:37Z")

</div>

I got two problems here.  
My CentOS version: 3.10.0-957.12.1.el7.x86\_64.  
I can't use 6.x and 7.0.0 elasticsearch on my system, but 5.x is OK!

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/3/3/331c734c3cc8ef4928d66883311e9612cd324816.png)  
as you can see, here is something different between. ES02 will stop itself after few seconds. I created the containers using

```auto
docker run -d -e ES_JAVA_OPTS="-Xmx256m -Xms256m" -p 9300:9300 -p 9200:9200 --name ES01 5acf0e8da90b

```

5.x can work well, but 6.x doesn't.

Another question is, the 9200 port is accessable, but 9300 port can't work well, I can't figure it out.  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/3/7/376fbdcc2d1464a2fa347ff09bfaa475664bc47e.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/3/43826f9ef49493734c53a01d770b067410141e6a.png)  
I also got some other informations here. 6.0 version's elasticsearch is not working, here is only 5.x version's port working.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/c/7/c7c74477c3f9974fe9f9b9072e9ec82e1b8df158.png)

---

<div class="post-metadata">

**Author:** ![yyfdayin](https://avatars.discourse-cdn.com/v4/letter/y/34f0e0/32.png) [@yyfdayin](https://discuss.elastic.co/u/yyfdayin)\
**Post date:** [May 2, 2019, 6:01am UTC](https://discuss.elastic.co/t/cant-access-9300-port/179281/2 "2019-05-02T06:01:50Z")

</div>

![image](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1aa49cf6107f8f56aa9a44ab6dfd72fedaea0cfd.png)

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 2, 2019, 6:03am UTC](https://discuss.elastic.co/t/cant-access-9300-port/179281/3 "2019-05-02T06:03:10Z")

</div>

Please don't post pictures of text, they are difficult to read and some people may not be even able to see them 🙂

---

<div class="post-metadata">

**Author:** ![yyfdayin](https://avatars.discourse-cdn.com/v4/letter/y/34f0e0/32.png) [@yyfdayin](https://discuss.elastic.co/u/yyfdayin)\
**Post date:** [May 2, 2019, 6:22am UTC](https://discuss.elastic.co/t/cant-access-9300-port/179281/4 "2019-05-02T06:22:18Z")

</div>

OK! I see it!

---

<div class="post-metadata">

**Author:** ![yyfdayin](https://avatars.discourse-cdn.com/v4/letter/y/34f0e0/32.png) [@yyfdayin](https://discuss.elastic.co/u/yyfdayin)\
**Post date:** [May 2, 2019, 6:25am UTC](https://discuss.elastic.co/t/cant-access-9300-port/179281/5 "2019-05-02T06:25:50Z")

</div>

root@localhost ~]# docker ps

```auto
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
47a1c095eb69 01e5bee1e059 "/usr/local/bin/dock…" 30 minutes ago Up 6 seconds 0.0.0.0:9201->9200/tcp, 0.0.0.0:9301->9300/tcp ES02
38eaa950bcea 5acf0e8da90b "/docker-entrypoint.…" About an hour ago Up About an hour 0.0.0.0:9200->9200/tcp, 0.0.0.0:9300->9300/tcp ES01

```

ES02 will stop itself in few seconds.

```auto
[root@localhost ~]# curl 127.0.0.1:9200
{
  "name" : "4FupYds",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "p29u7QWgT1yuHnOfG6CHGw",
  "version" : {
    "number" : "5.6.12",
    "build_hash" : "cfe3d9f",
    "build_date" : "2018-09-10T20:12:43.732Z",
    "build_snapshot" : false,
    "lucene_version" : "6.6.1"
  },
  "tagline" : "You Know, for Search"
}
[root@localhost ~]# curl 127.0.0.1:9300
curl: (56) Recv failure: Connection reset by peer

```

And, I can't get to port 9300, but I can add data through prot 9200!

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 2, 2019, 6:46am UTC](https://discuss.elastic.co/t/cant-access-9300-port/179281/6 "2019-05-02T06:46:07Z")

</div>

Why do you want to access port 9300? It's uses a binary protocol so you cannot curl it.

---

<div class="post-metadata">

**Author:** ![yyfdayin](https://avatars.discourse-cdn.com/v4/letter/y/34f0e0/32.png) [@yyfdayin](https://discuss.elastic.co/u/yyfdayin)\
**Post date:** [May 2, 2019, 7:37am UTC](https://discuss.elastic.co/t/cant-access-9300-port/179281/7 "2019-05-02T07:37:34Z")

</div>

Thanks for your raply!  
I want to add data through port 9300, just like:

```auto
        Book book = new Book();
        book.setId(1);
        book.setBookName("boook");
        book.setAuthor("Alice");
        bookRepository.index(book);

```

The setting of springdata is:

```auto
spring.data.elasticsearch.cluster-name=elasticsearch
spring.data.elasticsearch.cluster-nodes=192.168.154.129:9300

```

But, there is always error:

```auto
ERROR 7604 --- [main] .d.e.r.s.AbstractElasticsearchRepository : failed to load elasticsearch nodes : org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: [{#transport#-1}{tDt8CjGjQOWscJeN44vXXA}{192.168.154.129}{192.168.154.129:9300}]

```

the firewall is already shut down, port 9200 is successfully mapped, but something is wrong with port 9300.  
And, why can't I use 6.x version's elasticsearch on my system? It always stop in few seconds after started. Is it normal?

---

<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:** [May 2, 2019, 8:02am UTC](https://discuss.elastic.co/t/cant-access-9300-port/179281/8 "2019-05-02T08:02:49Z")

</div>

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

Or use markdown style like:

````
```
CODE
```

````

This is the icon to use if you are not using markdown format:

![image](https://us1.discourse-cdn.com/elastic/original/3X/7/e/7e6e239431ec2d71cbf1beef741f2e93e7cc762c.jpg)

There's a live preview panel for exactly this reasons.

Lots of people read these forums, and many of them will simply skip over a post that is difficult to read, because it's just too large an investment of their time to try and follow a wall of badly formatted text.  
If your goal is to get an answer to your questions, it's in your interest to make it as easy to read and understand as possible.  
Please update your post.

Why did you say that your cluster stopped ? How do you know? If so what are elasticsearch logs ?

BTW as you are using Docker, you need to define in the TransportClient the same cluster name that the Docker image is using or set cluster name to elasticsearch.

---

<div class="post-metadata">

**Author:** ![yyfdayin](https://avatars.discourse-cdn.com/v4/letter/y/34f0e0/32.png) [@yyfdayin](https://discuss.elastic.co/u/yyfdayin)\
**Post date:** [May 2, 2019, 9:11am UTC](https://discuss.elastic.co/t/cant-access-9300-port/179281/9 "2019-05-02T09:11:27Z")

</div>

Sorry about my post.  
My cluster is not stop when I use 5.x version, it only happens with 6.x version or 7.0.0.  
I can index data using JestClient through port 9200:

```auto
    @Autowired
    JestClient jestClient;

```

But if I use ElasticsearchRepository, the error is appeared.

```auto
public interface BookRepository extends ElasticsearchRepository<Book,Integer>

```

I think maybe something was wrong with port 9300.

```auto
ERROR 6472 --- [main] .d.e.r.s.AbstractElasticsearchRepository : failed to load elasticsearch nodes : org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: [{#transport#-1}{cJwWjxSQS9y8buLJebxoxg}{192.168.154.129}{192.168.154.129:9300}]

```

Thank you for your help!

---

<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:** [May 2, 2019, 1:43pm UTC](https://discuss.elastic.co/t/cant-access-9300-port/179281/10 "2019-05-02T13:43:36Z")

</div>

I don't understand. If you are using JEST, then you are using the HTTP Rest port (9200).  
Why do you want to use the binary Transport port (9300) with Jest then?

---

<div class="post-metadata">

**Author:** ![yyfdayin](https://avatars.discourse-cdn.com/v4/letter/y/34f0e0/32.png) [@yyfdayin](https://discuss.elastic.co/u/yyfdayin)\
**Post date:** [May 2, 2019, 2:45pm UTC](https://discuss.elastic.co/t/cant-access-9300-port/179281/11 "2019-05-02T14:45:51Z")

</div>

I use ElasticsearchRepository with port 9300. Here is the code.

```auto
public interface BookRepository extends ElasticsearchRepository<Book,Integer>

```

I want to put data into elasticsearch.

```auto
    @Autowired
    BookRepository bookRepository;

    bookRepository.index(book);

```

The setting of springboot:

```auto
spring.data.elasticsearch.cluster-name=elasticsearch
spring.data.elasticsearch.cluster-nodes=192.168.154.129: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:** [May 2, 2019, 2:58pm UTC](https://discuss.elastic.co/t/cant-access-9300-port/179281/12 "2019-05-02T14:58:15Z")

</div>

> [@yyfdayin](#):
>
> I use ElasticsearchRepository with port 9300

Why?

---

<div class="post-metadata">

**Author:** ![yyfdayin](https://avatars.discourse-cdn.com/v4/letter/y/34f0e0/32.png) [@yyfdayin](https://discuss.elastic.co/u/yyfdayin)\
**Post date:** [May 3, 2019, 2:51am UTC](https://discuss.elastic.co/t/cant-access-9300-port/179281/13 "2019-05-03T02:51:20Z")

</div>

> [@dadoonet](#):
>
> ElasticsearchRepository

Is ElasticsearchRepository no longer available or it should work with port 9200? I look up many pages, they all use it just like:

```auto
spring: 
    data:
       elasticsearch: 
            cluster-name: es 
            cluster-nodes: 192.168.120.103:9300,192.168.120.104:9300

```

```auto
spring.data.elasticsearch.cluster-name=elasticsearch
spring.data.elasticsearch.cluster-nodes=127.0.0.1:9300
spring.data.elasticsearch.repositories.enabled=true

```

Did I get it wrong?

---

<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:** [May 3, 2019, 3:11am UTC](https://discuss.elastic.co/t/cant-access-9300-port/179281/14 "2019-05-03T03:11:17Z")

</div>

I have no idea. I was just confused by the Jest reference which is using 9200 REST port.  
I'm not a spring data elasticsearch user as I prefer to build my own DAO. Like here:

> <https://github.com/dadoonet/legacy-search/blob/06-fuzziness/src/main/java/fr/pilato/demo/legacysearch/dao/ElasticsearchDao.java>

Anyway if you are using the deprecated TransportClient, you must make sure that the cluster name is elasticsearch or change the client settings as explained in this documentation: [https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/transport-client.html](https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/transport-client.html)

---

<div class="post-metadata">

**Author:** ![yyfdayin](https://avatars.discourse-cdn.com/v4/letter/y/34f0e0/32.png) [@yyfdayin](https://discuss.elastic.co/u/yyfdayin)\
**Post date:** [May 6, 2019, 1:39pm UTC](https://discuss.elastic.co/t/cant-access-9300-port/179281/15 "2019-05-06T13:39:05Z")

</div>

Thanks a lot!

---

<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:** [June 3, 2019, 1:39pm UTC](https://discuss.elastic.co/t/cant-access-9300-port/179281/16 "2019-06-03T13:39:09Z")

</div>

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