How to get all index on a specific machine?

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.

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.

OK, I will try it!
Thanks :smile:

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