📷 Paparazzo - The Elasticsearch Snapshot Storage Tool
Introduction
Paparazzo is a tool for the automation of Elasticsearch data backup and restoration, utilising Amazon's S3. The Elasticsearch cluster will require the S3 Repository Plugin to be installed on all nodes in the target cluster for both backup and restoration.
This library currently only supports Elasticsearch versions 5+.
Installation
Paparazzo can be installed using pip:
pip install paparazzo
Use
from paparazzo import Paparazzo
p = Paparazzo(
hosts=['example.node1', 'example.node2', 'example.node3'],
access_key='ACCESS_KEY',
secret_key='SECRET_KEY',
region='eu-west-1',
bucket='paparazzo-test-bucket'
)
# To create a snapshot
p.snapshot_from_indices(['foo', 'bar'], 'test_repository', 'test_snapshot')
# To restore from a snapshot
p.restore_from_snapshot(['foo', 'bar'], 'existing_repository', 'existing_snapshot')
AWS S3 User Policy
The S3 user must have a policy containing at least the permissions below applied to it.
Ensure to replace example-bucket
with the name of your own bucket.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "s3:ListAllMyBuckets",
"Resource": "arn:aws:s3:::*"
},
{
"Effect": "Allow",
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::example-bucket",
"arn:aws:s3:::example-bucket/*"
]
}
]
}
License
Paparazzo is made available under the terms of the MIT License, as stated in the file LICENSE