# Discover nodes from ES client

**URL:** <https://discuss.elastic.co/t/discover-nodes-from-es-client/48547>\
**Category:** Elasticsearch\
**Created:** [April 27, 2016, 12:25pm UTC](https://discuss.elastic.co/t/discover-nodes-from-es-client/48547 "2016-04-27T12:25:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dinushan\_m](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dinushan_m/32/8095_2.png) [@dinushan\_m](https://discuss.elastic.co/u/dinushan_m)\
**Post date:** [April 27, 2016, 12:25pm UTC](https://discuss.elastic.co/t/discover-nodes-from-es-client/48547/1 "2016-04-27T12:25:23Z")

</div>

I have a java ES client connects to a pre configured IP.  
Typically ES runs @port 9200. But when the master node is down, another node is elected as the master but it runs @port 9201.

Is there a way for ES client to discover the master nodes port ?  
Or should I try ports starting from 9200 and up.

---

<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 5, 2017, 10:56pm UTC](https://discuss.elastic.co/t/discover-nodes-from-es-client/48547/2 "2017-07-05T22:56:00Z")

</div>


