Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Kan du få data tilbake igjen fra dine Elasticsearch snapshots?

Kan du få data tilbake igjen fra dine Elasticsearch snapshots?

Elasticsearch offers the snapshot/restore API for handling backups. How do you actually get data back from a snapshot? Have you ever tried. This lightning talk demonstrates usages of the restore API and strategies for restoring data back into Elasticsearch with and without downtime.

Jan Fredrik Wedén

September 08, 2016
Tweet

More Decks by Jan Fredrik Wedén

Other Decks in Programming

Transcript

  1. PUT /_snapshot/my_repo { "type": "fs | url | s3 |

    azure | hdfs", settings… } PUT /_snapshot/my_repo/snap_1
  2. PUT /_snapshot/my_repo { "type": "fs | url | s3 |

    azure | hdfs", settings… } PUT /_snapshot/my_repo/snap_1 GET /_snapshot/my_repo/snap_1 DELETE /_snapshot/my_repo/snap_1
  3. DELETE _all PUT /_snapshot/my_utv_repo { "type": "url", "settings": { "url":

    "location/of/prod" } } Setting to allow DELETE <* | _all> should always be disabled in PROD, and preferably in all envs.
  4. DELETE _all PUT /_snapshot/my_utv_repo { "type": "url", "settings": { "url":

    "location/of/prod" } } POST /_snapshot/my_utv_repo/snap_1/_restore { "indices": "config,…", … } Setting to allow DELETE <* | _all> should always be disabled in PROD, and preferably in all envs.
  5. POST /_snapshot/my_repo/snap_1/_restore { "indices": "config", "include_global_state": false, "rename_pattern": "(.+)", "rename_replacement":

    "restored_$1” } GET /restored_config/global_type/super_important_doc PUT /config/global_type/super_important_doc { the GET data above }
  6. POST /_snapshot/my_repo/snap_1/_restore { "indices": "config", "include_global_state": false, "rename_pattern": "(.+)", "rename_replacement":

    "restored_$1” } GET /restored_config/global_type/super_important_doc PUT /config/global_type/super_important_doc { the GET data above } DELETE /restored_config