Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
First pass at backing up elasticsearch indices and restoring them. No…
…t tested.
  • Loading branch information
Michelle Beard committed Mar 23, 2016
1 parent 28d1135 commit e8e7567f30447f3ac05702dc6470cdffaa105f42
Showing 2 changed files with 21 additions and 0 deletions.
@@ -0,0 +1,18 @@
#!/bin/bash
INDEXNAME="xdata_v3, xdata_v2"
BACKUPDIR="/mnt/es-backups/"

sudo mkdir -p $BACKUPDIR || exit $?

# Create the repository
curl -XPUT 'http://localhost:9200/_snapshot/xdata_backup' -d `{ "type" : "fs",
"settings" : {
"location" : "$BACKUPDIR",
"max_snapshot_bytes_per_sec" : "50mb",
"max_restore_bytes_per_sec" : "50mb"
}
}`


# Backup only relevant indices. We speciy this as to prevent backing up the .kibana index and any other test indexes that were created
curl -XPUT 'http://localhost:9200/_snapshot/xdata_backup/snapshot' -d `{ "indices" : "$INDEXNAME" }`
@@ -0,0 +1,3 @@
#!/bin/bash
# Restore snapshot
curl -XPUT 'http://localhost:9200/_snapshot/xdata_backup/snapshot_restore'

0 comments on commit e8e7567

Please sign in to comment.