From 3bacbe6cc79a7a6c9f2b57b3e6a6fce896023dfa Mon Sep 17 00:00:00 2001 From: gcolpart Date: Thu, 19 Jul 2018 16:34:13 +0200 Subject: [PATCH] infos pour restaurer un snapshot --- HowtoElasticsearch.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/HowtoElasticsearch.md b/HowtoElasticsearch.md index 1a795a57..0f51e7c5 100644 --- a/HowtoElasticsearch.md +++ b/HowtoElasticsearch.md @@ -336,6 +336,20 @@ $ for i in $(ls -1d snapshot-* | head -n -10 | sed s'/snapshot-snapshot_//g'); d hot_${i}"; done ~~~ +### Restauration d'un snapshot + +Le snapshot doit être listé dans le snapshot repository. + +Pour restaurer le snapshot `snapshot.daily` : + +~~~ +$ curl -XPOST "localhost:9200/_snapshot/snaprepo/snapshot.daily/_restore" +{"accepted":true} +~~~ + +> *Note* : si vous avez un message d'erreur du type `{"error":"SnapshotRestoreException[[snaprepo:snapshot.daily] cannot restore index [foo] because it's open]","status":500}` vous pouvez fermer l'index en faisant `curl -XPOST "localhost:9200/foo/_close` + + ## Rotation des logs Elasticsearch fait de lui-même une rotation des logs en datant le fichier du jour et en créant un nouveau fichier. Par contre, aucune compression ni nettoyage n'est fait. Il est possible de déclencher une tâche tous les jours pour faire cela :