[DEPRECATED] Backups of a MariaDB server to an S3 bucket using Mariabackup
2.1K
This image does backups of a MariaDB server using Mariabackup to an S3 bucket (or compatible, like Digital Ocean Spaces). Backups are streamed so there is no need for temporary disk space to hold a copy of the database. Optionally, you can set up a S3 bucket lifecycle policy to delete files after a certain amount of days.
Limitations/design decisions are favoring simplicity:
It backs up the database with Mariabackup and streams it to a single lbzip2 compressed file (bzip2 compatible, multi-core port) with xbstream and uploads it to S3 with s3gof3r.
The backup is a single file with a timestamp name like 20191201-235701.xb.
When first run, if RETENTION_DAYS is set, a lifecycle policy will be created and applied.
Mount the MYSQL data directory on /var/lib/mysql.
Define the following environment variables:
MYSQL_USERMYSQL_PASSWORDMYSQL_HOSTS3_BUCKET_NAMES3_ENDPOINT (eg. s3.eu-west-1.amazonaws.com or fra1.digitaloceanspaces.com)AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYAWS_REGION (eg. eu-west-1 or fra1)WAIT_SECONDS (number of seconds to wait between backups, if not set backup is run once)RETENTION_DAYS (number of days copies are retained, defaults to not set, which means no retention policy is set on the bucket)Stop mysql and run /restore.sh name_of_object_to_restore.xb.bz2 inside the container. Then start mysql.
Content type
Image
Digest
Size
134.6 MB
Last updated
over 4 years ago
docker pull mobilejazz/mariadb-backup-s3