Elasticsearch

failed to obtain in-memory shard lock

joonsei 2022. 12. 21. 17:59

문제 발생

샤드 할당에 대한 메모리 내 잠금(OpenSearch Service에 설정된 임계값 이내)을 얻지 못하면 다음과 같은 오류 메시지

해결 방법

노란색 클러스터 상태 문제 해결

클러스터가 노란색 상태로 전환되도록 하는 인덱스를 식별하려면 다음 쿼리를 사용

curl -XGET "localhost:9200/_cat/indices?v&health=yellow"

그런 다음 클러스터 할당되지 않은 샤드의 근본 원인을 확인하려면 다음 쿼리 사용

curl -XGET "localhost:9200/_cluster/allocation/explain"

 

최대 재시도 설정 늘리기

 클러스터를 녹색 상태로 되돌리려면 각 노란색 인덱스의 최대 재시도 횟수를 늘립니다.

curl -XPUT "localhost:9200/<yellow-index-name>/_settings" -H 'Content-Type: application/json' -d '
{
    "index.allocation.max_retries": 10
}
'