Skip to content

Repository files navigation

Shutterbug

Automate creation of ElasticSearch snapshots in an S3 repository.

Build Status

Table of Contents

Environment variables

NameDescriptionDefault
DEBUGWhether to produce debug messages in the logFalse
ES_HOSTFull URL for the ElasticSearch instancehttp://elasticsearch:9200
REPOSITORY_NAMEName of the repository to use and create if not presents3
REMOVE_OLDER_THAN_DAYSNumber of days of snapshots to keep (0 to disable)0
SLACK_WEBHOOK_URLWebhook URLhttp://slack/webhook/url
ENABLE_SLACKWhether to use the SLACK_WEBHOOK_URL to emit messageFalse
REPOSITORY_SETTINGSJSON blob for repository-s3 settings{"type": "s3", "settings": {"bucket":"bucket-name"}}
INDEX_NAMESList of comma-separated index names to snapshot (empty = all)
IGNORE_UNAVAILABLEignore_unavailable parameter for snapshotFalse
SNAPSHOT_PREFIXSnapshots will be named with this prefix
INCLUDE_GLOBAL_STATEinclude_global_state parameter for snapshotTrue
REQUEST_TIMEOUT_SECONDSTimeout value for general ES requests30
SNAPSHOT_TIMEOUT_SECONDSTimeout value for ES snapshot requests (0 to disable)60
SLACK_MESSAGE_PREFIXSlack messages will receive this prefix"shutterbug: "

REPOSITORY_SETTINGS

Documentation of settings can be found here: https://www.elastic.co/guide/en/elasticsearch/plugins/current/repository-s3-repository.html

The REPOSITORY_SETTINGS value is the JSON blob that is used when creating the snapshot repository.

Usage

docker run -t -i --rm --name shutterbug \
--env ES_HOST='http://elasticsearch.local:9200' \
--env REPOSITORY_NAME='my_s3_repository' \
--env REMOVE_OLDER_THAN_DAYS='30' \
--env SLACK_WEBHOOK_URL='https://slack.com/webhooks/id/token' \
--env ENABLE_SLACK='True' \
--env REPOSITORY_SETTINGS='{"type": "s3", "settings": {"bucket":"my-s3-bucket", "base_path": "my/backup/prefix", "storage_class": "standard_ia"}}' \
fractos/shutterbug

This will attempt to create the snapshot repository if it doesn't already exist using a command similar to:

PUT _snapshot/my_s3_repository
{
"type": "s3",
"settings": {
"bucket": "my-s3-bucket",
"base_path":"my/backup/prefix",
"storage_class": "standard_ia"
}
}

About

Automate creation of ElasticSearch snapshots in an S3 repository.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages