Table of Contents

Driven Administration Guide

version 1.1.1

Implementing a backup strategy for your Driven Application

To achieve disaster recovery, you must implement a policy for taking regular snapshots of your Driven repository. To achieve this, first install the Driven client as described in Installing the Driven Client.

To see all the parameters available with the Driven client backup option, enter:

$ driven backup --help

java driven.management.backup.Backup [options...]

Optional:
 env vars: DRIVEN_CLUSTER, DRIVEN_HOSTS

Option                       Description
------                       -----------
--bucket                     s3 bucket for repository
--cluster                    driven cluster name (default: driven)
--debug [Boolean]            enable debugging (default: false)
--delete                     name of snapshot to delete from repository
--delete-older-than          delete snapshots older than supplied date ( yyyy-MM-dd )
--display-width <Integer>    width of display (default: 80)
--help
--hosts                      driven server host(s) (default: localhost)
--json [Options$JsonOpts]    output data as json (default: values)
--list                       list repositories, or if --repository is used list
                               snapshots in repository
--no-header
--path                       specify filesystem path for repository
--prefix                     s3 prefix for repository bucket (default: snapshots)
--print                      print query parameters
--region                     aws region for repository bucket (default: us-east-1)
--register-fs                register a local repository with name
--register-s3                register a remote S3 repository with name
--repository                 name of repository
--restore                    name of snapshot to restore from repository
--snapshot                   name of snapshot to create in repository
--unregister                 name of repository to unregister
--verbose                    logging level (default: info)

There are three key components to recovering your repository from a snapshot:

  • Specify the location where backups will be stored in a repository

  • Create a backup snapshot in the repository

  • Recover from a snapshot

There are two ways to create a repository. You can either specify the repository in driven.properties, or you can use the Driven client to create the repository.

Step 1: - Option 1 Create a repository with driven.properties

To create only one default repository, add the following to the driven.properties file. Use either Amazon S3 or File System respository:

For Amazon S3:

driven.backup.repository.type=
driven.backup.repository.bucket=
driven.backup.repository.path=
driven.backup.repository.region=

For shared File System repository:

driven.backup.repository.type=fs
driven.backup.repository.path=

Step 1: - Option 2 Create a repository with Driven client

For Amazon S3 (servers in a cluster must have appropriate AWS credentials for the bucket):

$ driven backup --register-s3 s3-repo --bucket driven-backup

registered S3 repository 's3-repo' at '[us-east] driven-backup/snapshots'

For shared file system repository (All the servers in a cluster must have read/write access to the registered path):

$ driven backup --register-fs fs-repo --path /opt/driven-backup/snapshot

registered FS repository 'fs-repo' at:
     '/opt/driven-backup/snapshots'

To list the repositories that you created:

$ driven backup --list

Repository            Type Location
----------            -------------
s3-repo       	      s3   s3://driven-backup/snapshots
fs-repo               fs   /opt/driven-backup/snapshots

Step 2: Create a snapshot

$ driven backup --repository s3-repo --snapshot snapshot_3
CREATING.........................
Snapshot                  State  	  Status    Started                    	     Finished
--------                  -----  	  ------    -------                    	     --------
snapshot_3                SUCCESS	  OK        Thu Jun 19 10:35:08 PDT 2014     Thu Jun 19 10:35:33 PDT 2014

If no argument is given, a date-based snapshot name is automatically chosen.

To list the snapshots that you created:

$ driven backup --repository s3-repo --list
Snapshot                 State  	Status  Started                    	   Finished
--------                 -----  	------  -------            	           --------
snapshot_1               SUCCESS	OK      Tue Jun 17 10:32:56 PDT 2014   Tue Jun 17 10:33:08 PDT 2014
snapshot_2               SUCCESS	OK      Tue Jun 17 11:33:02 PDT 2014   Tue Jun 17 11:33:15 PDT 2014

Step 3: To restore from a snapshot

$ driven backup --repository s3-repo --restore snapshot_2
RESTORING........
snapshot snapshot_2 restore status 200
Note
In the example above, snapshot name "snapshot_2" is restored.

Next