Support Questions

Find answers, ask questions, and share your expertise

HBase data migration from one cluster to other cluster

avatar
Contributor

Hi, Need help with HBase data migration from one cluster to other cluster. Please share the instructions or any proper articles.

Thanks.

1 ACCEPTED SOLUTION

avatar

Dhiraj

There are many method to achieve the same like copytable , import/export utility , snapshot . I would prefer snapshot method .But snapshot method will work if Hbase is of same version in both the cluster .If your both cluster hbase versions are different then you can use Copytable method.

snapshot method :

STEP 1: Go to hbase-shell and Take a snapshot of table

>hbase shell

>snapshot "SOURCE_TABLE_NAME","SNAPSHOT_TABLE_NAME"

Step 3 : Export that snapshot to other cluster

>bin/hbase org.apache.hadoop.hbase.snapshot.ExportSnapshot -snapshot SNAPSHOT_TABLE_NAME -copy-to hdfs://DESTINATION_CLUSTER_ACTIVE_NAMENODE_ADDRESS:8020/hbase -mappers 16

STEP 4: restore the table on DESTINATION Cluster :

>hbase shell

>disable "DEST_TABLENAME"

>restore_snapshot "SNAPSHOT_TABLE_NAME"

View solution in original post

5 REPLIES 5

avatar

Dhiraj

There are many method to achieve the same like copytable , import/export utility , snapshot . I would prefer snapshot method .But snapshot method will work if Hbase is of same version in both the cluster .If your both cluster hbase versions are different then you can use Copytable method.

snapshot method :

STEP 1: Go to hbase-shell and Take a snapshot of table

>hbase shell

>snapshot "SOURCE_TABLE_NAME","SNAPSHOT_TABLE_NAME"

Step 3 : Export that snapshot to other cluster

>bin/hbase org.apache.hadoop.hbase.snapshot.ExportSnapshot -snapshot SNAPSHOT_TABLE_NAME -copy-to hdfs://DESTINATION_CLUSTER_ACTIVE_NAMENODE_ADDRESS:8020/hbase -mappers 16

STEP 4: restore the table on DESTINATION Cluster :

>hbase shell

>disable "DEST_TABLENAME"

>restore_snapshot "SNAPSHOT_TABLE_NAME"

avatar
Contributor
@Anurag Mishra

Thanks for the detailed steps, but will snapshot take cares of DDLs too? or do we need to take a DDL and create it manually in the destination cluster?

Thanks,

Dhiraj.

avatar
New Contributor

Which user do you need to be to execute these commands? I'm getting PermissionDenied Error. Please advise.

TIA

avatar
Community Manager

@trent_larson As this is an older post, you would have a better chance of receiving a resolution by starting a new thread. This will also provide the opportunity to provide details specific to your environment that could aid others in providing a more accurate answer to your question. 



Regards,

Vidya Sargur,
Community Manager


Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community:

avatar