首先是索引运行中的常用命令:
1.cluster-allocation-explain API
这个API主要是为了方便解决下面两个问题:
-
对于不能指派(unassigned)的分片: 解释这些分片不能被指派(到某个节点)的原因.
-
对于已指派的分片: 解决这些分片指派到特定节点的理由.
curl -XPOST ip:9200/_cluster/allocation/explain?pretty
curl -XGET ip:9200/_cluster/allocation/explain?pretty -d '{"index":"my_index","shard":0,"primary":true}'
//查看指定的node
参考文档:https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-allocation-explain.html