List indices with shards on a given node

Elasticsearch 6.

Is there a nice way to get a list of indices shards of which are on a given node? The only way I can find is to call _cat/shards and grep the output for the node name. Node information in Kibana Monitoring shows which indices are on that node but I don't know how it gets that list.

Since making the previous post I've realised that what I actually want is a way to set settings for all indices with shards on a node and only those indices. But I can't see a way to do that, other than to get a list of what's on a given node and then parse that. And making use of such a list could be quite tediously slow and/or fiddly even when automated because I'm working with nodes that have shards from ~500 indices on and putting the names of all those in to a single curl command like index1,index2,index3 doesn't work because the list is too long so it would have to be done in chunks.

What I'd like to do is set index.unassigned.node_left.delayed_timeout as described at https://www.elastic.co/guide/en/elasticsearch/reference/6.8/delayed-allocation.html on all the indices shards of which are on a node just before it's temporarily taken out of the cluster for maintenance. I could just set it on all indices, but I'd prefer to set it only on indices which are actually affected by the node going away.

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