Using https://github.com/klevo/docker-percona/ as base image, this will add
Mandatory Docker System Environment
docker-compose.yml for example.
AWS_ACCESS_KEY: AWS Access Key to be used when uploading backups to S3 bucket.
AWS_SECRET_KEY: AWS Secret Key to be used when uploading backups to S3 bucket.
MYSQL_ROOT_PASSWORD: Root password for MySQL.
S3_BUCKET: Location of the S3 backup. For eg:
BACKUP_DISABLED: Set this to skip the backup.
Optional Docker System Environment
INNOBACKUPEX_MEMORY: Amount of memory allocated for restoring process. Defaulted to
BACKUPDIR: Location of the backup in the container. Defaulted to
innobackupexis scheduled to run every 2 hours.
- When it is running, it will perform either full or incremental backup into local filesystem.
- The most recent full backup and associated incremental backups will be always available on the local filesystem.
- Previous backups will be archived into S3 bucket and deleted from the local filesystem. This is done to prevent excessive usage of storage.
Restore Process (Must be done within the container)
If the Docker container is totally destroyed, copy from S3 backup path
BACKUPDIRdirectory in the container.
s3cmd cp $S3_BUCKET $BACKUPDIR
rm -rf /var/lib/mysql/*
innobackupex-restore, specifying the first parameter from the targetted backup. This can be either full or incremental backup.