Desculpe-nos, mas este texto está apenas disponível em Inglês Americano. For the sake of viewer convenience, the content is shown below in the alternative language. You may click the link to switch the active language.

Here is an sample for backup hbase tables. In this example we are exporting OpenTSDB tables.
First it’s necessary to export tables do the HDFS and then execute -get to save the files in the local system.

[code] #!/bin/bash

DATAREF=`date +"%Y-%m-%d"`
BKPDIR=/backup/$DATAREF

mkdir $BKPDIR

sudo -u hdfs hadoop dfs -rm -f -r /dump-tsdb
sudo -u hdfs hbase org.apache.hadoop.hbase.mapreduce.Export tsdb /dump-tsdb
sudo -u hdfs hadoop dfs -get /dump-tsdb $BKPDIR
sudo -u hdfs hadoop dfs -rm -f -r /dump-tsdb

sudo -u hdfs hadoop dfs -rm -f -r /dump-tsdb-tree
sudo -u hdfs hbase org.apache.hadoop.hbase.mapreduce.Export tsdb-tree /dump-tsdb-tree
sudo -u hdfs hadoop dfs -get /dump-tsdb-tree $BKPDIR
sudo -u hdfs hadoop dfs -rm -f -r /dump-tsdb-tree

sudo -u hdfs hadoop dfs -rm -f -r /dump-tsdb-uid
sudo -u hdfs hbase org.apache.hadoop.hbase.mapreduce.Export tsdb-uid /dump-tsdb-uid
sudo -u hdfs hadoop dfs -get /dump-tsdb-uid $BKPDIR
sudo -u hdfs hadoop dfs -rm -f -r /dump-tsdb-uid

sudo -u hdfs hadoop dfs -rm -f -r /dump-tsdb-meta
sudo -u hdfs hbase org.apache.hadoop.hbase.mapreduce.Export tsdb-meta /dump-tsdb-meta
sudo -u hdfs hadoop dfs -get /dump-tsdb-meta $BKPDIR
sudo -u hdfs hadoop dfs -rm -f -r /dump-tsdb-meta

cd $BKPDIR
tar -cjf hbase_bkp_$DATAREF.tar.bz2 dump-*
rm -fr $BKPDIR/dump-*[/code]

To restore:[code] $ bin/hbase org.apache.hadoop.hbase.mapreduce.Import <tablename> <inputdir>[/code]

Reference:
Chapter 14. Apache HBase (TM) Operational Management