Search code examples
amazon-s3hbasecloudera-cdh

How to import hbase snapshot from s3


I exported hbase snapshot to s3.
I used this command.

hbase org.apache.hadoop.hbase.snapshot.ExportSnapshot -snapshot my-snapshot -copy-to s3://my-buckets/tests -mappers 16

But, how can I import s3 snapshot to my hbase?
I read many posts about export snapshot to other. But, I could not find how to import snapshot from s3.
In other words, how can I create new table from s3 snapshot?

Environment
EC2 instances
CDH 5.14.1
HBase 1.2


Solution

  • You can use the same ExportSnapshot command to import snapshot by specifying -copy-from with s3a path and -copy-to with your server details.

    Example:

    hbase org.apache.hadoop.hbase.snapshot.ExportSnapshot -snapshot my-snapshot  -copy-from s3a://my-buckets/tests   -copy-to hdfs://<name-node>:8020/hbase     -mappers 16