Amazon OpenSearch Service에서 "cannot restore index \[.kibana\]"(“색인 [.kibana]를 복원할 수 없음”)라는 오류를 해결하려면 어떻게 해야 하나요?

2분 분량
0

Amazon OpenSearch Service의 수동 스냅샷에서 색인을 복원하려고 하면, 오류 메시지가 현시되면서 복원에 실패해요.

해결 방법

Amazon OpenSearch Service는 .kibana 색인을 모니터링하고 그것이 삭제되면 다시 생성합니다. 이 동작으로 인해 다음 오류 메시지가 현시되면서 복원에 실패할 수 있습니다.

{
    "error": {
        "root_cause": [{
            "type": "snapshot_restore_exception",
            "reason": "[repository-name:snapshot-name/1A2B34aZQFWQpFOYYJfxmQ] cannot restore index [.kibana] because an open index with same name already exists in the cluster. Either close or delete the existing index or restore the index under a different name by providing a rename pattern and replacement name"
        }],
        "type": "snapshot_restore_exception",
        "reason": "[repository-name:snapshot-name/1A2B34aZQFWQpFOYYJfxmQ] cannot restore index [.kibana] because an open index with same name already exists in the cluster. Either close or delete the existing index or restore the index under a different name by providing a rename pattern and replacement name"
    },
    "status": 500
}

이 문제를 해결하려면, 다음 단계를 수행하세요.

1.    색인을 복원하고 .kibana 색인의 이름을 다음과 같이 바꾸세요.

# restore indices.   $ curl -XPOST -H 'Content-Type: application/json' 'https://your-domain-end-point/_snapshot/your-repository-name/your-snapshot-name/_restore' -d'
{
    "indices": "*",
    "ignore_unavailable": true,
    "include_global_state": false,
    "rename_pattern": ".kibana",
    "rename_replacement": "restored_.kibana"
}

이 예시에서는 .kibana 색인의 이름이 "restored_.kibana"(“복원된_.kibana”)로 변경되었습니다.

2.    _reindexAPI 작업을 사용하여 이름 "restored_.kibana"(“복원된_.kibana”)를 “.kibana”로 다시 바꾸세요.

# reindex restored_.kibana to .kibana
$ curl -XPOST -H 'Content-Type: application/json' 'https://your-domain-end-point/_reindex' -d'
{
    "source": {
        "index": "restored_.kibana"
    },
    "dest": {
        "index": ".kibana"
    }
}

이제 수동 스냅샷에서 색인을 복원할 수 있습니다.

AWS 공식
AWS 공식업데이트됨 10달 전