Gebruikershulpmiddelen

Site-hulpmiddelen


werkinstructies:snapshots_in_elasticsearch

Verschillen

Dit geeft de verschillen weer tussen de geselecteerde revisie en de huidige revisie van de pagina.

Link naar deze vergelijking

Beide kanten vorige revisie Vorige revisie
Volgende revisie
Vorige revisie
werkinstructies:snapshots_in_elasticsearch [2017/06/30 09:40]
abel [Snapshots gebruiken voor een restore]
werkinstructies:snapshots_in_elasticsearch [2017/07/06 16:32] (huidige)
abel [Snapshots gebruiken voor een restore]
Regel 1: Regel 1:
 ====== Snapshots in elasticsearch ====== ====== Snapshots in elasticsearch ======
  
-Om in een backup te maken van een index, bijvoorbeeld de .kibana index om zo de gedefinieerde searchesvisualisaties en Dashboards veilig te stellen kan je snapshots gebruiken.+Om in een backup te maken van een index, bijvoorbeeld de ''.kibana'' index om zo de gedefinieerde SearchesVisualisations en Dashboards veilig te stellenkan je snapshots gebruiken.
  
 Snapshots worden geregeld door de _snapshot plug-in die standaard mee geïnstalleerd is. Snapshots worden geregeld door de _snapshot plug-in die standaard mee geïnstalleerd is.
Regel 69: Regel 69:
 Controleer of de snapshot gelukt is: Controleer of de snapshot gelukt is:
  
-''curl -XGET localhost:9200/_snapshot/index_backups/kibana_snapshot''+''curl -XGET localhost:9200/_snapshot/index_backups/kibana_snapshot?pretty=true''
  
-de output moet iets zijn als (let op meestal krijg je alles in een regel)+de output moet iets zijn als:
 <code/> <code/>
-{"snapshots": [{ +{ 
- "snapshot":"kibana_snapshot", +  "snapshots" : [ { 
- "version_id":2040099, +    "snapshot" : "kibana_snapshot", 
- "version":"2.4.0", +    "version_id" : 2040099, 
- "indices":[".kibana"], +    "version" : "2.4.0", 
- "state":"SUCCESS", +    "indices" : [ ".kibana" ], 
- "start_time":"2017-06-29T14:23:42.105Z", +    "state" : "SUCCESS", 
- "start_time_in_millis":1498746222105, +    "start_time" : "2017-06-29T14:23:42.105Z", 
- "end_time":"2017-06-29T14:23:42.277Z", +    "start_time_in_millis" : 1498746222105, 
- "end_time_in_millis":1498746222277, +    "end_time" : "2017-06-29T14:23:42.277Z", 
- "duration_in_millis":172, +    "end_time_in_millis" : 1498746222277, 
- "failures":[], +    "duration_in_millis" : 172, 
- "shards":{"total":1, +    "failures" : [ ], 
- "failed":0, +    "shards" : { 
- "successful":+      "total" : 1, 
- +      "failed" : 0, 
- ]}+      "successful" : 1 
 +    
 +  ]
 } }
 </code> </code>
Regel 104: Regel 106:
  
 ''curl -XDELETE localhost:9200/_snapshot/index_backups/snapshot_naampje'' ''curl -XDELETE localhost:9200/_snapshot/index_backups/snapshot_naampje''
 +
 ===== Snapshots gebruiken voor een restore ===== ===== Snapshots gebruiken voor een restore =====
 +
 +De ''.kibana'' index kan je alleen terug gezet kan worden als deze gesloten is.
 +
 +je kan de ''.kibana'' index sluiten door:
 +
 +''curl -XPOST localhost:9200/.kibana/_close''
 +
 +en je kan hem heropenen door:
 +
 +''curl -XPOST localhost:9200/.kibana/_open''
 +
  
 ==== Een hele snapshot terug zetten ==== ==== Een hele snapshot terug zetten ====
 +
 +''curl -XPOST localhost:9200/_snapshot/index_backups/snapshot_naampje/_restore''
 +
 +Dit zet alle indices in de snapshot ''snapshot_naampje'' terug.
 +
  
 ==== Een specifieke index uit een snapshot terug zetten ==== ==== Een specifieke index uit een snapshot terug zetten ====
  
 +Om 1 index uit een snapshot terug te zetten, bv de ''.kibana'' index uit ons voorbeeld snapshot:
 +
 +''%%curl -XPOST localhost:9200/_snapshot/index_backups/snapshot_naampje/_restore -d '{ "indices": ".kibana" }' %%''
  
  
Regel 120: Regel 142:
 https://en.blog.kodcu.com/2014/11/introduction-to-elasticsearch-snapshot-and-restore-module/ https://en.blog.kodcu.com/2014/11/introduction-to-elasticsearch-snapshot-and-restore-module/
  
 +https://www.karelbemelmans.com/2015/03/elasticsearch-backup-script-with-snapshot-rotation/
  
werkinstructies/snapshots_in_elasticsearch.1498808457.txt.gz · Laatst gewijzigd: 2017/06/30 09:40 door abel