ISM Error Prevention API
출처: 문서
본문
ISM 오류 방지 API
ISM 오류 방지 API를 사용하면 Index State Management(ISM) 오류 방지를 활성화하고 검증 상태와 메시지를 확인할 수 있어요.
오류 방지 검증 활성화
plugins.index_state_management.action_validation.enabled 파라미터를 설정하여 오류 방지 검증을 구성할 수 있어요.
예제 요청
PUT _cluster/settings
{
"persistent":{
"plugins.index_state_management.action_validation.enabled": true
}
}
{% include copy-curl.html %}
예제 응답
{
"acknowledged" : true,
"persistent" : {
"plugins" : {
"index_state_management" : {
"action_validation" : {
"enabled" : "true"
}
}
}
},
"transient" : { }
}
Explain API를 사용하여 검증 상태 및 메시지 확인
Explain API URI에 validate_action=true 경로 파라미터를 전달하면 검증 상태와 메시지를 볼 수 있어요.
예제 요청
GET _plugins/_ism/explain/test-000001?validate_action=true
{% include copy-curl.html %}
예제 응답
{
"test-000001" : {
"index.plugins.index_state_management.policy_id" : "test_rollover",
"index.opendistro.index_state_management.policy_id" : "test_rollover",
"index" : "test-000001",
"index_uuid" : "CgKsxFmQSIa8dWqpbSJmyA",
"policy_id" : "test_rollover",
"policy_seq_no" : -2,
"policy_primary_term" : 0,
"rolled_over" : false,
"index_creation_date" : 1667410460649,
"state" : {
"name" : "rollover",
"start_time" : 1667410766045
},
"action" : {
"name" : "rollover",
"start_time" : 1667411127803,
"index" : 0,
"failed" : false,
"consumed_retries" : 0,
"last_retry_time" : 0
},
"step" : {
"name" : "attempt_rollover",
"start_time" : 1667411127803,
"step_status" : "starting"
},
"retry_info" : {
"failed" : true,
"consumed_retries" : 0
},
"info" : {
"message" : "Previous action was not able to update IndexMetaData."
},
"enabled" : false,
"validate" : {
"validation_message" : "Missing rollover_alias index setting [index=test-000001]",
"validation_status" : "re_validating"
}
},
"total_managed_indices" : 1
}
검증 상태와 메시지는 validate_action=true를 전달할 때만 반환돼요. 파라미터를 false로 설정하거나 생략하면 둘 다 반환되지 않아요.
예제 요청
GET _plugins/_ism/explain/test-000001?validate_action=false
{% include copy-curl.html %}
파라미터를 생략해도 동일한 결과가 나타나요:
GET _plugins/_ism/explain/test-000001
{% include copy-curl.html %}
예제 응답
{
"test-000001" : {
"index.plugins.index_state_management.policy_id" : "test_rollover",
"index.opendistro.index_state_management.policy_id" : "test_rollover",
"index" : "test-000001",
"index_uuid" : "CgKsxFmQSIa8dWqpbSJmyA",
"policy_id" : "test_rollover",
"policy_seq_no" : -2,
"policy_primary_term" : 0,
"rolled_over" : false,
"index_creation_date" : 1667410460649,
"state" : {
"name" : "rollover",
"start_time" : 1667410766045
},
"action" : {
"name" : "rollover",
"start_time" : 1667411127803,
"index" : 0,
"failed" : false,
"consumed_retries" : 0,
"last_retry_time" : 0
},
"step" : {
"name" : "attempt_rollover",
"start_time" : 1667411127803,
"step_status" : "starting"
},
"retry_info" : {
"failed" : true,
"consumed_retries" : 0
},
"info" : {
"message" : "Previous action was not able to update IndexMetaData."
},
"enabled" : false
},
"total_managed_indices" : 1
}