evobackup/install/etc/evobackup/actions.d/14_elasticsearch.disabled
Benoît S. 3df881ca22 New script for Elasticsearch 1.0
in actions.d/14_elasticsearch.disabled
2014-02-13 19:00:48 +01:00

29 lines
1 KiB
Bash
Executable file

#!/bin/bash
# Dump/Snapshots for Elasticsearch 1.0
## Yout need to register a repository, this action need to be only done one time,
## but you must register a repository on all nodes!
## $ curl -XPUT 'http://localhost:9200/_snapshot/backup' -d '{
## "type": "fs",
## "settings": {
## "location": "/home/backup-elasticsearch",
## "compress": true
## }
## }'
## Delete old snapshots. Handled in EvoBackup.
# rm -rf /home/backup/elasticsearch/*
## Take a snapshot on master node.
# date=$(date +%Y%m%d%H%M)
# curl -XPUT "localhost:9200/_snapshot/backup/snapshot_${date}?wait_for_completion=true"
## To restore: List snapshots, close all indexes & restore one snapshot.
## curl -XGET "localhost:9200/_snapshot/backup/_all?pretty=true"
## curl -XPOST "localhost:9200/_all/_close"
## rsync master node:/home/backup/elasticsearch to slaves nodes
## example : rsync -av --delete /home/backup/elasticsearch node:/home/backup/elasticsearch
## restore snapshots
## curl -XPOST "localhost:9200/_snapshot/backup/snapshot_DATE/_restore?wait_for_completion=true"
exit 0