HBase favicon

Apache HBase

Administration of Backup Images

Managing HBase backup images including listing, describing, deleting, and merging backup sets for efficient storage.

The hbase backup command has several subcommands that help with administering backup images as they accumulate. Most production environments require recurring backups, so it is necessary to have utilities to help manage the data of the backup repository. Some subcommands enable you to find information that can help identify backups that are relevant in a search for particular data. You can also delete backup images.

The following list details each hbase backup subcommand that can help administer backups. Run the full command-subcommand line as the HBase superuser.

Managing Backup Progress

You can monitor a running backup in another terminal session by running the hbase backup progress command and specifying the backup ID as an argument.

For example, run the following command as hbase superuser to view the progress of a backup

$ hbase backup progress <backup_id>

Positional Command-Line Arguments

backup_id
Specifies the backup that you want to monitor by seeing the progress information. The backupId is case-sensitive.

Named Command-Line Arguments

None.

Example usage

hbase backup progress backupId_1467823988425

Managing Backup History

This command displays a log of backup sessions. The information for each session includes backup ID, type (full or incremental), the tables in the backup, status, and start and end time. Specify the number of backup sessions to display with the optional -n argument.

$ hbase backup history <backup_id>

Positional Command-Line Arguments

backup_id
Specifies the backup that you want to monitor by seeing the progress information. The backupId is case-sensitive.

Named Command-Line Arguments

-n <num_records>
(Optional) The maximum number of backup records (Default: 10).

-p <backup_root_path>
The full filesystem URI of where backup images are stored.

-s <backup_set_name>
The name of the backup set to obtain history for. Mutually exclusive with the -t option.

-t <table_name>
The name of table to obtain history for. Mutually exclusive with the -s option.

Example usage

$ hbase backup history
$ hbase backup history -n 20
$ hbase backup history -t WebIndexRecords

Describing a Backup Image

This command can be used to obtain information about a specific backup image.

$ hbase backup describe <backup_id>

Positional Command-Line Arguments

backup_id The ID of the backup image to describe.

Named Command-Line Arguments

None.

Example usage

$ hbase backup describe backupId_1467823988425

Deleting Backup Images

The hbase backup delete command deletes backup images that are no longer needed.

Syntax

$ hbase backup delete -l <backup_id1,backup_id2,...>
$ hbase backup delete -k <days>

Named Command-Line Arguments

-l <backup_id1,backup_id2,...>
Comma-separated list of backup IDs to delete.

-k <days>
Deletes all backup images completed more than the specified number of days ago.

These options are mutually exclusive. Only one of -l or -k may be used at a time.

Example Usage

Delete specific backup images by ID:

$ hbase backup delete -l backupId_1467823988425,backupId_1467824989999

Delete all backup images older than 30 days:

$ hbase backup delete -k 30
  • Deleting a backup may affect all following incremental backups (in the same backup root) up to the next full backup. For example, if you take a full backup every 2 weeks and daily incremental backups, running hbase backup delete -k 7 when the full backup is older than 7 days will effectively remove the data for all subsequent incremental backups. The backup IDs may still be listed, but their data will be gone.

  • If the most recent backup is an incremental backup and you delete it, you should run a full backup next. Running another incremental backup immediately after may result in missing data in the backup image. (See HBASE-28084)

Backup Repair Command

This command attempts to correct any inconsistencies in persisted backup metadata which exists as the result of software errors or unhandled failure scenarios. While the backup implementation tries to correct all errors on its own, this tool may be necessary in the cases where the system cannot automatically recover on its own.

$ hbase backup repair

Positional Command-Line Arguments

None.

Named Command-Line Arguments

None.

Example usage

$ hbase backup repair

On this page