Wenn ich versuche, Indizes aus manuellen Snapshots in Amazon OpenSearch Service wiederherzustellen, schlägt die Wiederherstellung fehl und es wird eine Fehlermeldung angezeigt.
Behebung
Amazon OpenSearch Service überwacht den .kibana-Index und erstellt den Index neu, wenn er gelöscht wird. Dieses Verhalten kann dazu führen, dass die Wiederherstellung fehlschlägt und die folgende Fehlermeldung angezeigt wird:
{
"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
}
Gehen Sie wie folgt vor, um dieses Problem zu beheben:
1. Stellen Sie die Indizes wieder her und benennen Sie den .kibana-Index wie folgt um:
# 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"
}
In diesem Beispiel wird der .kibana-Index in „restored_.kibana“ umbenannt.
2. Benutze den API-Vorgang _reindex, um „restored_.kibana“ wieder in „.kibana“ umzubenennen, etwa so:
# 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"
}
}
Sie können Ihre Indizes jetzt aus einem manuellen Snapshot wiederherstellen.