#查看全部分片html
GET _cat/shards负载均衡
curl 10.1.2.2:9200/_cat/indices/iis_log* #查看索引的分片状态curl
#查看第一个unassigned shard的缘由
GET /_cluster/allocation/explainelasticsearch
#查看iis_qr_2019-07索引中全部分片分配状况
GET /_cat/shards?index=iis_Log_2019-07ide
#查看unassigned缘由:
curl noahes.isec.oa.com/_cluster/allocation/explain?pretty -d '{"index":"index-name","shard":0,"primary":true}'ui
GET /_cluster/allocation/explain
{
"index": "iis_log_2019-07",
"shard": 0,
"primary": true
}url
#shard 自动分配达到最大重试次数5次后,执行reroute命令对分片从新路由,ElasticSearch会自动进行负载均衡
POST /_cluster/reroute?retry_failed=truecode
1)INDEX_CREATED:因为建立索引的API致使未分配。
2)CLUSTER_RECOVERED :因为彻底集群恢复致使未分配。
3)INDEX_REOPENED :因为打开open或关闭close一个索引致使未分配。
4)DANGLING_INDEX_IMPORTED :因为导入dangling索引的结果致使未分配。
5)NEW_INDEX_RESTORED :因为恢复到新索引致使未分配。
6)EXISTING_INDEX_RESTORED :因为恢复到已关闭的索引致使未分配。
7)REPLICA_ADDED:因为显式添加副本分片致使未分配。
8)ALLOCATION_FAILED :因为分片分配失败致使未分配。
9)NODE_LEFT :因为承载该分片的节点离开集群致使未分配。
10)REINITIALIZED :因为当分片从开始移动到初始化时致使未分配(例如,使用影子shadow副本分片)。
11)REROUTE_CANCELLED :做为显式取消从新路由命令的结果取消分配。
12)REALLOCATED_REPLICA :肯定更好的副本位置被标定使用,致使现有的副本分配被取消,出现未分配。htm
https://www.elastic.co/guide/en/elasticsearch/reference/6.2/cluster-allocation-explain.html索引