Painless Elasticsearch backup to S3
Elasticsearch automatic backup to S3.
There's also IAM policy example to run shell script from a configured AWS cli environment.
Before you start:
- be sure you have AWS cli installed for your envornment and configured with AWS access & secret;
- be sure to set the right policy on your IAM user to run script;
- Setup the elasticsearch.yml to register your FS repository path on the PATH section of elasticsearch.yml
path.repo: /home/elasticsearch_backups
and reload the engine with
service elasticsearch restart
or equivalent for you OS; - Register your backup running
curl -X PUT "localhost:9200/_snapshot/mybackup" -H 'Content-Type: application/json' -d'{"type": "fs","settings": {"location": "/path/to/my/backup/folder","compress": true}}'
- Modify the script;
- Enjoy :).