Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

For disaster recovery and possibly, server replication, we are providing a script that backups will backup any GOBII GOBii instance. This script takes a snapshot (commit) of the docker Docker image passed as a parameter and pushes that commit point to dockerhub Dockerhub in the given repository, making the whole process incremental. The TAG that will be used is the current timestamp – of the format YYYY-MM-DD_hh-mm-ss, ex. 2017-05-26_10-49-57. Clients can, however, easily change the timestamp format by modifying that string in the script.

Note

The intention of this script is to be used in cronjobs for incremental backups of GOBII GOBii instances. 


Usage

Warning

Run this as user 'gadm' or your GOBII GOBii admin user account, which should be a sudoer. But do not run the script as sudo. It will prompt for password as needed. Also, make sure you use bash instead of just sh when running the script.

...

Code Block
languagebash
themeMidnight
titleUsage Template
bash backup_dockerDocker_to_hub.sh <name_of_docker>Docker> <dockerhub<Dockerhub_username> <dockerhubpassword<Dockerhubpassword | askme> <dockerhub<Dockerhub_repository_name>
#Set dockerhubpasswDockerhubpassw parameter to 'askme' for the script to prompt for password instead -- useful for single runs, but not for cronjobs

...

Code Block
languagebash
themeMidnight
titleExample Usage
bash backup_dockerDocker_to_hub.sh gobiiGOBii_db_icrisat cegicrisat dummypassw123 gobiiGOBii_db_icrisat_prod


The command above creates a snapshot backup of the DB docker Docker node of ICRISAT's production server, with a tag of the timestamp when it was ran. In ICRISAT's docker Docker hub account, we can see:


The frequency of the backups is entirely up to the client. Docker Hub doesn't impose any limit in the size of the repository, and an account can have as many public repositories as you want and 1 private repository for free. Paid subscriptions are available for more than 1 private repository at a very reasonable price. Note that only the database docker Docker needs to be private as it contains the client's data (iei.e. metadata like markers, samples, projects, etc.) while the web and the compute dockers Dockers do not contain any sensitive information.

...

Info

This backup will not include the GOBII GOBii data bundle (/data/gobiiGOBii_bundle) which contains your instance configuration, loaded files, scripts, IFL, MDEs, HDF5 genotype data, etc. Typically, this bundle is in your file server (depending on your installation setup, which varies from CG to CG), but you are responsible to do regular backups of that path as well, maybe via scheduled rsyncs or whatever works for your organization. This leads to my suggestion of how to do a GOBII GOBii production server's disaster recovery strategy below.

...

  • Decide on the frequency of your incremental backup, ex. every 12 hours, on non-peak hours.
  • Create a cron job for each of your nodes (db, web, compute) that uses the script, backup_dockerDocker_to_hub.sh, and pass the correct parameters.
    • It is important that they are in (almost) perfect sync. The script for each node can run in parallel.
  • The script does not require that the dockers Dockers be stopped before backing up, so it can be ran run without any down-time. But there are instances when there are operations you don't want to commit (ex. in the middle of loading huge GBS data), so it still is optimal to do the backups on non-peak hours.
  • Set a cron job for backing up your GOBII GOBii bundle at the same time. You can use rsync for incremental backups of plain directories like this. Note that you need to backup back up the whole gobiiGOBii_bundle directory (typically in /data/gobiiGOBii_bundle).
    • It will be best if you use the same timestamp in backing up the gobiiGOBii_bundle as you used in backing up the dockersDockers. This way, the restore scripts will only need one tag/timestamp to restore (or replicate) a whole GOBII GOBii instance.


Info

The script is docker Docker agnostic and can be used on any docker Docker instance. It is also rather simple. You can get it from, and available here: http://gobiin1GOBiin1.bti.cornell.edu:6083/projects/GM/repos/gobiideploymentGOBiideployment/browse/backup_dockerDocker_to_hub.sh