Comment puis-je résoudre l'erreur « cannot restore index [.kibana] » (Impossible de restaurer l'index [.kibana]) dans Amazon OpenSearch Service ?
Dernière mise à jour : 23/07/2021
Lorsque j'essaie de restaurer des indices à partir d'instantanés manuels dans Amazon OpenSearch Service, la restauration échoue avec un message d'erreur. Comment puis-je résoudre ce problème ?
Résolution
Amazon OpenSearch Service contrôle 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, suivez les étapes suivantes :
1. Restaurez les index et renommez l'index .kibana, comme ceci :
# 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": true,
"rename_pattern": ".kibana",
"rename_replacement": "restored_.kibana"
}
Dans cet exemple, l'index .kibana est renommé « restored_.kibana ».
2. Utilisez l'opération d'API _reindex pour renommer « restored_.kibana », « .kibana », comme ceci :
# 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.
Cet article vous a-t-il été utile ?
Besoin d'aide pour une question technique ou de facturation ?