This repository has been archived by the owner. It is now read-only.
Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -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" }` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
# Restore snapshot | ||
curl -XPUT 'http://localhost:9200/_snapshot/xdata_backup/snapshot_restore' |