Pending cluster tasks

原文链接 : https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-pending.html

译文链接 : http://www.apache.wiki/display/Elasticsearch/Pending+cluster+tasks

贡献者 : 那伊抹微笑

pending cluster tasks(添加集群任务)API 返回一个集群级别中还没有被执行的操作的列表(例如,创建索引,更新映射,分配或故障的分片)。

注意 :

API 返回一个正在添加到更新集群状态的任务列表。这些是通过 Task Management API 从任务报告的。它包括了由用户发起的周期性任务和定期任务,例如节点状态,搜索查询,或者创建索引请求。然后,如果用户初始化任务(像创建索引命令)会造成集群状态更新,该任务的活动可能由 task apipending cluster tasks API 来报告。

  1. $ curl -XGET 'http://localhost:9200/_cluster/pending_tasks'

通常这个操作会返回一个空的列表,因为集群中的变化通常是很快的。然而如果有任务在队列中,该输出可能如下 :

  1. {
  2. "tasks": [
  3. {
  4. "insert_order": 101,
  5. "priority": "URGENT",
  6. "source": "create-index [foo_9], cause [api]",
  7. "time_in_queue_millis": 86,
  8. "time_in_queue": "86ms"
  9. },
  10. {
  11. "insert_order": 46,
  12. "priority": "HIGH",
  13. "source": "shard-started ([foo_2][1], node[tMTocMvQQgGCkj7QDHl3OA], [P], s[INITIALIZING]), reason [after recovery from shard_store]",
  14. "time_in_queue_millis": 842,
  15. "time_in_queue": "842ms"
  16. },
  17. {
  18. "insert_order": 45,
  19. "priority": "HIGH",
  20. "source": "shard-started ([foo_2][0], node[tMTocMvQQgGCkj7QDHl3OA], [P], s[INITIALIZING]), reason [after recovery from shard_store]",
  21. "time_in_queue_millis": 858,
  22. "time_in_queue": "858ms"
  23. }
  24. ]
  25. }