Using Apache HBase to store and access data
Also available as:
PDF
loading table of contents...

Using backup sets

Backup sets can ease the administration of HBase data backups and restores by reducing the amount of repetitive input of table names.

You can group tables into a named backup set with the hbase backup set add command. You can then use the -set option to invoke the name of a backup set in the hbase backup create or hbase backup restore rather than list individually every table in the group. You can have multiple backup sets.

Note
Note

Note the differentiation between the hbase backup set add command and the -set option. The hbase backup set add command must be run before using the -set option in a different command because backup sets must be named and defined before using backup sets as shortcuts.

If you run the hbase backup set add command and specify a backup set name that does not yet exist on your system, a new set is created. If you run the command with the name of an existing backup set name, then the tables that you specify are added to the set.

In the command, the backup set name is case-sensitive.

Note
Note

The metadata of backup sets are stored within HBase. If you do not have access to the original HBase cluster with the backup set metadata, then you must specify individual table names to restore the data.

Backup set subcommands

To create a backup set, run the following command as hbase superuser.

hbase backup set COMMAND [name] [tables]

COMMAND is one of the following:

                   
add
remove
list
describe
delete
                 
backup_set_name
tables

Following list details subcommands of the hbase backup set command.

Note
Note

You must enter one (and no more than one) of the following subcommands after hbase backup set to complete an operation. Also, the backup set name is case-sensitive in the command-line utility.

add

Use this subcommand to add tables to a backup set. Specify a backup_set_name value after this argument to create a backup set.

Example of backup set addExample

hbase backup set add Q1Data TEAM_3,TEAM_4

Depending on the environment, this command results in one of the following actions:

  • If the Q1Data backup set does not exist, a backup set containing tables TEAM_3 and TEAM_4 is created.

  • If the Q1Data backup set exists already, the tables TEAM_3 and TEAM_4 are added to the Q1Data backup set.

remove

Use this subcommand to remove tables from a set. Specify the tables to remove in the tables argument.

list

Use this subcommand to list all backup sets.

describe

Use this subcommand to display on the screen a description of a backup set. The information includes whether the set has full or incremental backups, start and end times of the backups, and a list of the tables in the set. This subcommand must precede a valid value for the backup_set_name value.

delete

Use this subcommand to delete a backup set. Enter the value for the backup_set_name option directly after the hbase backup set delete command.

Optional command-line arguments

backup_set_name

Use this argument to assign or invoke a backup set name. The backup set name must contain only printable characters and cannot have any spaces.

tables

List of tables (or a single table) to include in the backup set. Enter the table names as a comma-separated list. If no tables are specified, all tables are included in the set.

Note
Note

Maintain a log or other record of the case-sensitive backup set names and the corresponding tables in each set on a separate or remote cluster, mirroring your backup strategy. This information can help you in case of failure on the primary cluster.