Friday 12 August 2016

Hbase Table backup/Restore

These are the following steps for backup/restore :


1 . Export table to hdfs directory :


hbase org.apache.hadoop.hbase.mapreduce.Export \
   <tablename> <outputdir> [<versions> [<starttime> [<endtime>]]]
   
Example:

hbase org.apache.hadoop.hbase.mapreduce.Export  test1  /hbase_backup/test1

Note: To import in different cluster/or if table is not in hbase ,table must be created in that particular cluster  before import command .



2.Import/Restore data in hbase cluster from hdfs

 Once table instance is created in hbase cluster :now we can import hbase table (restore)

Command :

hbase org.apache.hadoop.hbase.mapreduce.Import <tablename> <inputdir>

Example:

hbase org.apache.hadoop.hbase.mapreduce.Import test1 /hbase_backup/test1


No comments:

Post a Comment