# How to get all index on a specific machine?

**URL:** <https://discuss.elastic.co/t/how-to-get-all-index-on-a-specific-machine/172906>\
**Category:** Elasticsearch\
**Created:** [March 19, 2019, 7:47am UTC](https://discuss.elastic.co/t/how-to-get-all-index-on-a-specific-machine/172906 "2019-03-19T07:47:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Todd](https://avatars.discourse-cdn.com/v4/letter/t/fbc32d/32.png) [@Todd](https://discuss.elastic.co/u/Todd)\
**Post date:** [March 19, 2019, 7:47am UTC](https://discuss.elastic.co/t/how-to-get-all-index-on-a-specific-machine/172906/1 "2019-03-19T07:47:31Z")

</div>

Hi,  
Now, I want to `exclude` a machine from cluster, but there are some closed indices located on it,so they will not be allocated to other nodes. How can I get all indexes that located on this machine?

Thanks.

---

<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:** [March 19, 2019, 10:37am UTC](https://discuss.elastic.co/t/how-to-get-all-index-on-a-specific-machine/172906/2 "2019-03-19T10:37:07Z")

</div>

I do not know of an API that allows you to see the nodes on which the data belonging to closed indices lives. I think what I'd do is the following (assuming you're on a 6.x version):

1. Get the list of closed indices from `GET _cat/indices`.

2. Correlate the index UUIDs against the directory names in `$DATA_PATH/nodes/*/indices/*` on the node.

3. For each matching index, open it, apply the `exclude` filter to move the shards elsewhere, wait for the relocations to complete, then close it again.

4. Verify that there is now no index data in `$DATA_PATH/nodes/*/indices/*` on the node.

---

<div class="post-metadata">

**Author:** ![Todd](https://avatars.discourse-cdn.com/v4/letter/t/fbc32d/32.png) [@Todd](https://discuss.elastic.co/u/Todd)\
**Post date:** [March 21, 2019, 6:39am UTC](https://discuss.elastic.co/t/how-to-get-all-index-on-a-specific-machine/172906/3 "2019-03-21T06:39:57Z")

</div>

OK, I will try it!  
Thanks 😄

---

<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:** [April 18, 2019, 6:39am UTC](https://discuss.elastic.co/t/how-to-get-all-index-on-a-specific-machine/172906/4 "2019-04-18T06:39:59Z")

</div>

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