Create a snapshot
View existing repositories
curl -XGET 'localhost:9200/_snapshot/_all?pretty=true'
Create a directory accessible to the user running elasticsearch
mkdir backup
chown -R elasticsearch:elasticsearch /path-to/backup
Let elasticsearch know about path.repo (or in elasticsearch.yaml)
./bin/elasticsearch -Dpath.repo=/path-to/backup
Create a snapshot repo
1 2 3 4 5 6 7 8 9 |
curl -X PUT "localhost:9200/_snapshot/osm" -H 'Content-Type: application/json' -d' { "type": "fs", "settings": { "compress" : true, "location": "/home/wd/elasticsearch-2.4.6/backup" } } ' |
Take a snapshot
curl -X PUT "localhost:9200/_snapshot/osm/snapshot_1?wait_for_completion=true"
Restore from Snapshot
todo…