Comment puis-je résoudre l'erreur « Impossible de restaurer l'index [.kibana] » dans Amazon OpenSearch Service ?

Lecture de 2 minute(s)
0

Lorsque j'essaie de restaurer des index à partir d'instantanés manuels dans Amazon OpenSearch Service, la restauration échoue et un message d'erreur s'affiche.

Résolution

Amazon OpenSearch Service surveille l'index .kibana et le recrée lorsqu'il est supprimé. Ce comportement peut entraîner l'échec de la restauration avec le message d'erreur suivant :

{
    "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
}

Pour résoudre ce problème, procédez comme suit :

1.    Restaurez les index et renommez l'index .kibana, comme suit :

# 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"
}

Dans cet exemple, l'index .kibana est renommé « restored_.kibana. »

2.    Utilisez l'opération API _reindex pour renommer « restored_.kibana » en « .kibana », comme suit :

# 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"
    }
}

Vous pouvez désormais restaurer vos index à partir d'un instantané manuel.

AWS OFFICIEL
AWS OFFICIELA mis à jour il y a 9 mois