How to backup MetalSoft¶
MetalSoft’s Global Controller stores all data. The Site controller is stateless and its configuration can be regenerated and does not need any backup. b The Global controller uses two databases that need to be backed up, the rest of containers are stateless and can be re-deployed. Both databases run inside docker containers.
MySQL
CouchDB
Enabling the automatic backup of the databases¶
MetalSoft provides a script to perform the backup automatically as part of a cron job, available on github. The script also supports the signing and shipping of the backup files to a remote location.
To use it:
Create the destination folder is created and writable by the user
mkdir {{backup_folder}}DR/
Add it to the CRON of one of the head nodes of the kubernetes system:
52 * * * * /usr/local/bin/cron_metalsoft_backup_dbs -u administrator -s 172.17.83.141 -d {{backup_folder}}DR/
Parameters for the backup script¶
The script can be invoked manually as well:
./test.sh --help
Usage: ./test.sh -e environment_namespace
Available parameters:
-e | -n = [required] environment namespace
-k = kubectl command to use
-l = Location of Backup Folder for all backups (default: {{backup_folder}})
-g = GPG email to use for signing the backup (check gpg --list-keys) PG_PASS env variable can be used to specify the GPG passphrase GPG_PASS_FILE env variable can be used to specify the GPG passphrase-file
-s = ssh host to rsync to
-p = ssh port (default: 22)
-u = ssh user (default: root)
-d = ssh destination