Back up and restore Watson Studio Local
This document walks through a full data backup and restore for Watson Studio Local
The main scenarios that are encountered are:
- Backup for future recovery
- Backup for move to a new cluster
- Restore from backup
Back up and restore images, settings, and user-home volume
Back up and restore custom images, dashboard settings from MongoDB, CloudantDB and user-home volume for the same version of Watson Studio Local 1.2.3 on clusters.
The following data is not included in this backup and won't be available in the restored cluster:
- Job runs and their associated job logs.
Locate and download patch 10. It includes the latest release of the backup and restore tools.
Performing backups using the master_backup.sh script
- Offline mode
- Offline mode restarts the cluster services. Stop all user environments and lock down the cluster
before performing the backup. Offline backup is the recommended method to back up Watson Studio Local.Note: Do not interrupt the master-backup.sh script while you're doing an offline mode backup.
- Online mode
- Online mode performs backups while the cluster is up; however, busy data objects might not get backed up.
- A
sec_file
that contains a password forencrypt/decrypt influxdb
data is required. - Install the bc rpm package on the master node
yum install bc
.
Using the master_backup.sh script
./master_backup.sh [-h] [-v] <-b /backup_dir> [-m offline] [-u excluded] [-c excluded] <-s /path_to_sec_file>
-h - help page (optional)
-v - display patch version
-b backup_dir - the path to where to save the backup tar files
-m offline - to run backup in "offline" mode. The default option is "online"
-u excluded - to exclude user-home backup. The default option is "included"
-c excluded - to exclude custom images backup. The default option is "included"
-s /sec_file - the path to the password file to encrypt/decrypt influxdb during backup/restore
./master_backup.sh -b /backup_dir -s /sec_file (run all backups online)
./master_backup.sh -b /backup_dir -u excluded -s /sec_file (run all backups online exclude user-home)
./master_backup.sh -b /backup_dir -c excluded -s /sec_file (run all backups online exclude custom images)
./master_backup.sh -b /backup_dir -u excluded -c excluded -s /sec_file (run all backups online exclude user-home and custom images)
./master_backup.sh -b /backup_dir -m offline -s /sec_file (run all backups offline)
./master_backup.sh -b /backup_dir -m offline -u excluded -s /sec_file (run all backups offline exclude user-home)
./master_backup.sh -b /backup_dir -m offline -c excluded -s /sec_file (run all backups offline exclude custom images)
./master_backup.sh -b /backup_dir -m offline -u excluded -c excluded -s /sec_file (run all backups offline exclude user-home and custom images)
- Custom images
- MongoDB
- CloudantDB
- InfluxDB
- User-home volume
- User-home volume
- InfluxDB
- CloudantDB
- MongoDB
- Custom images
Running the backup and restore scripts manually
Back up and restore custom images
backup-restore-customimages.sh
backs up and restores custom images. The processing
time for backing up and restoring custom images depends on the number of images.- To save the custom images inside user-home storage volume, specify the path of the backup
directory. For example:
./backup-restore-customimages.sh [ -b | --backup ] /backupdir
- During the restore process, the saved custom image are uploaded from the user-home to docker
registry. For
example:
./backup-restore-customimages.sh [ -r | --restore ] /backupdir
Back up and restore MongoDB
backup-restore-mongo.sh
script backs up and restores the admin dashboard SMTP settings from MongoDB. However, the process
won't restore metrics and alerts.- To download the admin settings from MongoDB and tar it with the following format:
mongo-${timestamp}.tar.gz
. You must specify the path of the backup directory. For example:./backup-restore-mongo.sh [ -b | --backup ] /backupdir/
- During the restore process, the saved custom images are uploaded back to the server. Specify the
full path of the tar file. For
example:
./backup-restore-mongo.sh [ -r | --restore ] /backupdir/mongo-20190508075844.tar.gz
Back up and restore CloudantDB
backup-restore-cloudant.sh
script backs up and restores the Cloudant database.
Cloudant contains user login information and other metadata.- During the backup process, the CloudantDB is backed up into a tar file
cloudant-backup.tar
. You must specify the path to the backup directory. For example:/backup-restore-cloudant.sh [ -b | --backup ] /backupdir
The archive file is an archived directory of json files that correspond to each exported database.
- During the restore process, the CloudantDB tar files are restored. Specify the full path of the
tar file. For example:
./backup-restore-cloudant.sh [ -r | --restore ] /backupdir/cloudant-20190508075844.tar.gz
Back up and restore InfluxDB
backup-restore-influxdb.sh
script backs up and restores InfluxDB. InfluxDB includes
machine-learning model evaluation history and all deployment metrics and history.- During the backup process, the InfluxDB is backed up into a tar file
/backup_dir/'influxdb-${timestamp}.tar.gz
. You must specify the path to the backup directory and the full path to the secret/password file. For example:./backup-restore-influxdb.sh -b /backup_dir /path_to_sec_file
- During the restore process, the InfluxDB tar file is restored. Specify the full path of the tar
file and the path to the password file. For
example:
Example: ./backup-restore-influxdb.sh -r /backup_dir/influxdb-20190829114646.tar.gz /path_to_sec_file
Back up and restore user-home volume
backup-restore-user-home.sh
script backs up and restores user-home.- During the backup process, back up the user-home volume to a tar file
user-home-${timestamp}.tar.gz
. You must specify the path of backup directory. For example:./backup-restore-user-home.sh [ -b | --backup ] /backupdir/
- During the restore process, the user-home tar is restored over a user-home volume. Specify the
full path of the tar file. For example:
./backup-restore-user-home.sh [ -r | --restore ] /backupdir/user-home-20190508075844.tar.gz
- Open the user-home.tar file.
- Mount user-home NFS/glusterFS volume over a mount-point directory.
- Copy the missing the files from the untarred user-home directory to the right location inside the mount-point directory.
Procedures for after performing a restore
All of the pods under the
dsx
namespace must be restarted after the restore process is complete. To do so,
run the following command:
kubectl get po -l 'heritage=Tiller,!job-name' -n dsx
--no-headers | awk '{system("kubectl delete po -n dsx " $1)}'