# Find master ID

**URL:** <https://discuss.elastic.co/t/find-master-id/197844>\
**Category:** Elasticsearch\
**Created:** [September 3, 2019, 12:00pm UTC](https://discuss.elastic.co/t/find-master-id/197844 "2019-09-03T12:00:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alex\_Davidovich](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@Alex\_Davidovich](https://discuss.elastic.co/u/Alex_Davidovich)\
**Post date:** [September 3, 2019, 12:00pm UTC](https://discuss.elastic.co/t/find-master-id/197844/1 "2019-09-03T12:00:05Z")

</div>

I am using elastic 7.2 and HighLevelRestClient in my JAVA project.  
How can I find the master node using the client?  
Something like \_cat/master in the Elastic REST API

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [September 3, 2019, 12:17pm UTC](https://discuss.elastic.co/t/find-master-id/197844/2 "2019-09-03T12:17:25Z")

</div>

You can use `_master` to refer to the currently-elected master node in various [cluster APIs](https://www.elastic.co/guide/en/elasticsearch/reference/7.3/cluster.html) such as `GET _nodes/_master`. But it is rather unusual to need to identify the currently-elected master, so you might be heading down the wrong path if you think you need to do this.

---

<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:** [October 1, 2019, 12:17pm UTC](https://discuss.elastic.co/t/find-master-id/197844/3 "2019-10-01T12:17:38Z")

</div>

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