ChameleonCloud / chi-in-a-box

Packaging the systems and operations of the Chameleon testbed
Apache License 2.0
14 stars 10 forks source link

refactor mysql s3 backup task #297

Closed msherman64 closed 2 months ago

msherman64 commented 2 months ago

The primary change in this commit is to replace use of the "aws-cli" tool with "rclone", as the AWS tools are not compatible with ceph rgw based s3 implementations.

Additionally, this removes support for the mysqldump based legacy backups, and refactors the backup script for readability and improved logging.

Behavior changes: Rather than only the latest backup file, rclone will copy any new files that are not present in the object store, but will NOT overwrite existing ones.

msherman64 commented 2 months ago

One concern (not sure best way to fix) is how to disable this.

We'd basically need a "enable_mariadb_backup_auto" flag, and have ansible ensure the relevant scripts and timers are removed if not set to true.

Mark-Powers commented 2 months ago

What is actually creating the backups now? Is this syncing the volume data directly?

msherman64 commented 2 months ago

What is actually creating the backups now? Is this syncing the volume data directly?

The backups are created by a cronjob on the deploy host which executes cc-ansible mariadb_backup, which uses mariabackup to create backups from the running mariadb server/cluster, and stores those backups into the mariadb_backup docker volume.

the cron job here just handles rotating those backup files, and copying them from this docker volume to an object store bucket.