How to copy an existing hbase table How to copy an existing hbase table hadoop hadoop

How to copy an existing hbase table


Assuming you want to copy the table on the same cluster you can use HBase snapshotsin the hbase shell you can

snapshot 'sourceTable', 'sourceTable-snapshot'clone_snapshot 'sourceTable-snapshot', 'newTable'


CopyTable command is very handy to replicate HBase Tables. Use it in the following way:

hbase org.apache.hadoop.hbase.mapreduce.CopyTable --new.name=Y X;


use hbase shell
1. make sure you enbale snapshot in hbase-site.xml

  <property>     <name>hbase.snapshot.enabled</name>     <value>true</value>    </property>

2. hbase> snapshot 'x' ,'snapshot_x'
3. hbase> clone_snapshot 'snapshot_x' ,'another_x'