[elasticsearch] task 확인 API

HI·2025년 1월 10일
0

elasticsearch 운영

목록 보기
6/7

elasticsearch에서 작업중인 task 확인 하는 방법

실행중인 task 확인하기

실행하는 task 확인하기(기본)

#실행하는 task 확인
GET _tasks 
#리스트형
GET _cat/tasks?v  

task id 로 확인하기

GET _tasks/노드ID:521843726   

특정 actions에 대해 task 확인하기

GET _tasks?actions=*actions_이름 
GET _tasks?actions=*reindex     //reindex
GET _tasks?actions=*search      //검색
GET _tasks?actions=*bulk        //색인

#리스트형
GET _cat/tasks?v&actions=*search
  • action 종류
"indices:data/read/search" (검색 중)
"cluster:monitor/tasks/lists" ... 등
"indices:data/write/bulk" (bulk 색인)

task actions 디테일하게 확인(수행하는 쿼리 등 확인 가능)

GET _tasks?actions=*search&detailed  
GET _tasks?actions=*bulk*&detailed  
GET _tasks?actions=*reindex*&detailed=true

#리스트형
GET _cat/tasks?v&actions=*search*&detailed=true
GET _cat/tasks?v&actions=*search*&detailed=true

검색 task 취소하기

검색 task 의 경우 요청을 받은 노드와 검색을 실행 중인 샤드가 있는 노드들이
부모-자식 구조로 task가 실행된다.

#예시
action                                task_id                          parent_task_id                 description
indices:data/read/search              코디노드UID:6818930                -                			  indices[test_idx,test_idx2], types[], search_type[QUERY_THEN_FETCH], source[{"from":0,"size":200,"query":{...}]
indices:data/read/search[phase/query] 데이터노드UID:442167287 		   코디노드UID:6818930  			  shardId[[test_idx][0]]
indices:data/read/search[phase/query] 데이터노드UID:888888888 		   코디노드UID:6818930  			  shardId[[test_idx][1]]
indices:data/read/search[phase/query] 데이터노드UID:532167287 		   코디노드UID:6818930  			  shardId[[test_idx2][0]]
.
.
.

부모,자식 task id 모두 조회

GET _tasks?actions=*search*&detailed => 자식까지 확인 (검색되는 각 노드)

부모 task_id 만 조회

GET _tasks?actions=*search&detailed => 부모만 확인 (쿼리를 받은 노드)
---> 자식의 actions은 search[phase/query] 이기 때문에 *search로는 걸리지 않는다.

task 취소

취소시에는 부모의 task를 취소하면 자식(데이터노드)까지 취소된다.

POST _tasks/코디노드UID:task_id/_cancel
profile
https://github.com/gaeunban

0개의 댓글