# Need to change 9300 port to connect

**URL:** https://discuss.elastic.co/t/need-to-change-9300-port-to-connect/18057
**Category:** Elasticsearch
**Created:** [June 12, 2014, 4:22am UTC](https://discuss.elastic.co/t/need-to-change-9300-port-to-connect/18057 "2014-06-12T04:22:47Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Ashish\_Raniwala](https://avatars.discourse-cdn.com/v4/letter/a/848f3c/32.png) [@Ashish\_Raniwala](https://discuss.elastic.co/u/Ashish_Raniwala)
#### Post date: [June 12, 2014, 4:22am UTC](https://discuss.elastic.co/t/need-to-change-9300-port-to-connect/18057/1 "2014-06-12T04:22:47Z")

</div>

Hi,

I want to deploy ES on a server which already has another application using  
9300 port. When I start ES, it automatically select next free port like  
9302 which is expected.

Problem is that I am unable to connect to ES cluster even if I specify 9302  
port in transport client, log shows that client is still trying to connect  
to 9300 port.

Client client = new TransportClient()  
.addTransportAddress(new InetSocketTransportAddress("host1", 9302))

- [Jacob "Jake" Fury] failed to get local cluster state for  
[#transport#-1][nds3070558][inet[10.52.192.144:9300]], disconnecting...

org.elasticsearch.transport.ReceiveTimeoutTransportException:  
[][inet[10.52.192.144:9300]][cluster/state] request\_id [0] timed out after  
[5044ms]

Can someone please confirm if it is possible to run ES if 9300 port is not  
available and if so provide me pointer on how to correctly specify port  
when creating java client.

Thanks,  
Ashish

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/a75dbb4d-eb71-4978-914a-0e9a95d4e4cb%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a75dbb4d-eb71-4978-914a-0e9a95d4e4cb%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Ashish\_Raniwala](https://avatars.discourse-cdn.com/v4/letter/a/848f3c/32.png) [@Ashish\_Raniwala](https://discuss.elastic.co/u/Ashish_Raniwala)
#### Post date: [June 12, 2014, 5:25am UTC](https://discuss.elastic.co/t/need-to-change-9300-port-to-connect/18057/2 "2014-06-12T05:25:20Z")

</div>

I disabled multicast and enabled unicast with right host and port mapping  
and that helped me to connect.

Let me know if there is any other better alternative.

Thanks,  
Ashish

On Thursday, 12 June 2014 09:52:47 UTC+5:30, Ashish Raniwala wrote:

> Hi,
> 
> I want to deploy ES on a server which already has another application  
> using 9300 port. When I start ES, it automatically select next free port  
> like 9302 which is expected.
> 
> Problem is that I am unable to connect to ES cluster even if I specify  
> 9302 port in transport client, log shows that client is still trying to  
> connect to 9300 port.
> 
> Client client = new TransportClient()  
> .addTransportAddress(new InetSocketTransportAddress("host1", 9302  
> ))
> 
> - [Jacob "Jake" Fury] failed to get local cluster state for  
> [#transport#-1][nds3070558][inet[10.52.192.144:9300]], disconnecting...
> 
> org.elasticsearch.transport.ReceiveTimeoutTransportException:  
> [inet[10.52.192.144:9300]][cluster/state] request\_id [0] timed out after  
> [5044ms]
> 
> Can someone please confirm if it is possible to run ES if 9300 port is not  
> available and if so provide me pointer on how to correctly specify port  
> when creating java client.
> 
> Thanks,  
> Ashish

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/cb5530eb-9d09-4b9a-9583-43c9ae86357c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/cb5530eb-9d09-4b9a-9583-43c9ae86357c%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![brian\_yoder](https://avatars.discourse-cdn.com/v4/letter/b/f1d935/32.png) [@brian\_yoder](https://discuss.elastic.co/u/brian_yoder)
#### Post date: [June 12, 2014, 4:40pm UTC](https://discuss.elastic.co/t/need-to-change-9300-port-to-connect/18057/3 "2014-06-12T16:40:57Z")

</div>

Have you updated the elasticsearch.yml configuration file on all of the  
hosts on which you run ES, and then uncommented the following setting and  
changed its value to 9302?

# Set a custom port for the node to node communication (9300 by default):

# 

# transport.tcp.port: 9300

So, change it to:

transport.tcp.port: 9302

Hope this helps.

Brian

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/9a4f994d-c307-494a-86a5-d68c4563cb1a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9a4f994d-c307-494a-86a5-d68c4563cb1a%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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: [July 6, 2017, 1:22am UTC](https://discuss.elastic.co/t/need-to-change-9300-port-to-connect/18057/4 "2017-07-06T01:22:59Z")

</div>


