2.X/7. Administration Monitoring Deployment

7-1-6. Pending Tasks

drscg 2017. 9. 23. 12:38

There are certain tasks that only the master can perform, such as creating a new index or moving shards around the cluster. Since a cluster can have only one master, only one node can ever process cluster-level metadata changes. For 99.9999% of the time, this is never a problem. The queue of metadata changes remains essentially zero.

새로운 index를 생성하거나, cluster에서 shard의 이동처럼, master만이 할 수 있는 특정 작업이 있다. cluster는 오직 하나의 master만을 가질 수 있기 때문에, 하나의 node만이 cluster 수준의 metadata 변경을 처리할 수 있다. 거의 대부분의 경우에서, 이것은 절대 문제가 되지 않는다. metadata 변경 queue는 기본적으로 비어 있다.

In some rare clusters, the number of metadata changes occurs faster than the master can process them. This leads to a buildup of pending actions that are queued.

어떤 희귀한 cluster에서는, metadata 변경 작업은 master가 그것을 처리하는 것보다 더 빨리 발생한다. 이로 인해, queue에 들어가 대기 작업 열을 만들게 된다.

The pending-tasks API will show you what (if any) cluster-level metadata changes are pending in the queue:

pending_tasks API는 queue에 대기하고 있는 cluster 수준의 metadata 변경 작업이 무엇인지(있다면)를 보여준다.

GET _cluster/pending_tasks

Usually, the response will look like this:

일반적으로, response는 다음과 같다.

{
   "tasks": []
}

This means there are no pending tasks. If you have one of the rare clusters that bottlenecks on the master node, your pending task list may look like this:

이것은 대기 작업이 없다는 것을 의미한다. master node에 병목현상이 있는 희귀한 cluster를 가지고 있다면, 대기 작업은 아래와 같이 나열될 것이다.

{
   "tasks": [
      {
         "insert_order": 101,
         "priority": "URGENT",
         "source": "create-index [foo_9], cause [api]",
         "time_in_queue_millis": 86,
         "time_in_queue": "86ms"
      },
      {
         "insert_order": 46,
         "priority": "HIGH",
         "source": "shard-started ([foo_2][1], node[tMTocMvQQgGCkj7QDHl3OA], [P],
         s[INITIALIZING]), reason [after recovery from gateway]",
         "time_in_queue_millis": 842,
         "time_in_queue": "842ms"
      },
      {
         "insert_order": 45,
         "priority": "HIGH",
         "source": "shard-started ([foo_2][0], node[tMTocMvQQgGCkj7QDHl3OA], [P],
         s[INITIALIZING]), reason [after recovery from gateway]",
         "time_in_queue_millis": 858,
         "time_in_queue": "858ms"
      }
  ]
}

You can see that tasks are assigned a priority (URGENT is processed before HIGH, for example), the order it was inserted, how long the action has been queued and what the action is trying to perform. In the preceding list, there is a create-index action and two shard-started actions pending.

우선 순위가 할당된 작업(예를 들어, URGENT 는 HIGH 보다 먼저 처리된다), 입력된 순서, 작업의 대기 시간, 작업이 수행하려는 것을 볼 수 있다. 위의 목록에서, create-index 작업, 두 개의 shard-started 작업이 대기 중이다.


'2.X > 7. Administration Monitoring Deployment' 카테고리의 다른 글

7-1-4. Cluster Stats  (0) 2017.09.23
7-1-5. Index Stats  (0) 2017.09.23
7-1-7. cat API  (0) 2017.09.23
7-2. Production Deployment  (0) 2017.09.23
7-2-1. Hardware  (0) 2017.09.23