I'm using the api _cat/shards to monitor my shards' info. Since I may have a large cluster and many shards, I would like to collect the info from each node instead of collecting them by one call.
As described in the doc,
local
(Optional, boolean) If true , the request retrieves information from the local node only. Defaults to false , which means information is retrieved from the master node.
But when I invoke this api on a data node, whether the param is true or false, it returns shards from all nodes.
I think here is a small misunderstanding what local is referring to. It is not referring to the fact that only local shards are returned. It is referring to the fact where the information about all shards is fetched from. By specifying local=true this information is fetched from the node that you are hitting the request with. If nothing is specified or false is picked, this information is fetched from the current master node.
BTW, how's the _cat/shards performance? If I got a index or cluster with hundreds or thousands shards, will it take long to response and have impact to cluster?
The impact of this API is usually fairly small even with thousands of shards, but you can certainly overwhelm your cluster by sending too many requests like this all at once.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.