Skip to end of metadata
Go to start of metadata

Part of the Joyent Percona Instance is Joyent QuickBackup, a fast non-blocking MySQL backup service powered by Percona Xtrabackup on the back end. This service is pre-configured with the username and password but disabled by default. The only settings you need to configure are the minute, hour, day, and expiredays.

In this topic:

Configuring Joyent Quickbackup

To configure the backup service, use the svccfg command to set the following values. By default, the service is set to backup every night at midnight

Property Description Accepted Values Default Value
quickbackup/username MySQL user for QuickBackup 16 characters qb-xxxxxxxx
quickbackup/password MySQL password for QuickBackup 41 characters xxxxxxxxxxx
quickbackup/minute Minute of the hour to backup 0-60 comma separated or 'all' 0
quickbackup/hour Hour of the day to backup 0-23 comma separated or 'all' 0
quickbackup/day Day of the week to backup sun-sat comma separated or 'all' all
quickbackup/expiredays Number of days to keep backups 1-255 or 'none' 3
quickbackup/databases Name of databases to backup dbname1,dbname2 or 'all' all
quickbackup/backupdir Name of directory to backup to /directory /backups
quickbackup/stream Streaming method for Quickbackup to use xbstream or tar xbstream

To see how properties are set for the service, use the svcprop command. For example:

13.1.0 and later
1.6.0 and earlier

To change a service property use the svccfg command. You specify which property you want to change and the value you want to set. For example, this command is setting the property value for the quickbackup/backupdir property:

13.1.0 and later
1.6.0 and earlier

When making a change to a Quickbackup property, you need to restart the service for the change to take effect:

13.1.0 and later
1.6.0 and earlier

You can then verify that your change was set correctly with svcprop.

Backup Files and Log Files

The location of the backup and log files is different depending on which image version you are running.

  13.1.0 and later 1.6.0 and earlier
backups /var/backups/percona /backups
logs /var/log/mysql/quickbackup-percona.log /var/log/mysql/quickbackup.log

Backing up Automatically

By default, the service is set to back up every night at midnight. To set the service to perform a backup every 15 minutes of every hour Monday, Tuesday, Wednesday, Thursday, and Friday, you would use the following svccfg commands:

13.1.0 and later
1.6.0 and earlier

After setting the properties use the svcadm command to refresh and restart the service:

13.1.0 and later
1.6.0 and earlier

If the backup completed successfully you will see a confirmation message in the log like the following:

At the end of every backup, QuickBackup cleans up the old backup files and removes them if they are older than the value set for quickbackup/expiredays. It does this by checking the last modification time of the backup file.

Backups are stored in files named %Y-%m-%d_%H-%M-%S-backup.tar.gz. The backup files contain all of the databases by default or each database you specified in the quickbackup/databases setting.

See Backup Files and Log Files for the location of the log file.

Backing up Manually

To make a backup manually (not on a schedule) with QuickBackup you can call the script by its self.

13.1.0 and later
1.6.0 and earlier

After the backup it will rotate the backup files to quickbackup/expiredays set.

Restoring From a Backup

To restore a backup:

  1. Shut down the MySQL server:
    13.3.0 and later
    13.1.0
    1.6.0 and earlier
  2. Indicate which backup you want to restore by passing in the path to the backup file:
    13.1.0 and later


    1.6.0 and earlier


    If successful, you will see a confirmation message that the restore completed successfully

If there is an error, you will need to check the QuickBackup log file. See Backup Files and Log Files for the location of the log file.

Once the restore is complete, re-enable MySQL:

13.3.0 and later
13.1.0
1.6.0 and earlier

At this point, everything is running from the restored backup.

Choosing a Streaming Method (optional)

In Quickbackup version 3.0 (and later), you can select between two different streaming methods for performing a backup: tar and xbstream.

  • Tar is the original method for Quickbackup. While it is much slower, it provides better compression.
  • Xbstream is the new method. It is much faster but does not provide as good compression.

The default is now xbstream, but you can use either.

You can configure the streaming method by setting the value of the quickbackup/stream property. To change it:

13.1.0 and later
1.6.0 and earlier
When doing a Quickbackup restore, you now need to specify the streaming method used for the backup from which you are trying to restore.

Below is a comparison of the time it takes to perform a backup between 'tar' and 'xbstream' on a 10 GB dataset.

tar: Time to back up 10 GB
xbstream: Time to back up 10 GB
Labels:
svccfg svccfg Delete
percona percona Delete
svcprop svcprop Delete
quickbackup quickbackup Delete
xtrabackup xtrabackup Delete
svcadm svcadm Delete
mysql mysql Delete
backup backup Delete
restoring restoring Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.