STEP 1 :-
Configuration
a) Add a property.
[ nitin@nitin-ubuntu:~ # ] sudo vim /etc/hbase/conf/hbase-site.xml
<property>
<name>hbase.snapshot.enabled</name>
<value>true</value>
</property>
b) Restart hbase
[ nitin@nitin-ubuntu:~ # ] sudo /usr/lib/hbase/bin/stop_hbase.sh
[ nitin@nitin-ubuntu:~ # ] sudo /usr/lib/hbase/bin/start_hbase.sh
Step 2 :-
Take a Snapshot
[ nitin@nitin-ubuntu:~ # ] hbase shell
hbase> snapshot 'MY_TABLE', 'SNAP_MYTABLE'
Step 3 :-
Listing Snapshots
[ nitin@nitin-ubuntu:~ # ] hbase shell
hbase> list_snapshots
Step 4 :-
Deleting Snapshots
[ nitin@nitin-ubuntu:~ # ] hbase shell
hbase> delete_snapshot 'SNAP_MYTABLE'
Step 5 :-
Clone a table from snapshot
[ nitin@nitin-ubuntu:~ # ] hbase shell
hbase> clone_snapshot 'SNAP_MYTABLE', 'NEW_TABLE'
Step 6 :-
Export to another cluster:-
[ nitin@nitin-ubuntu:~ # ] hbase org.apache.hadoop.hbase.snapshot.ExportSnapshot -snapshot SNAP_Target_toys_Prods -copy-to hdfs://CLUSTER2:8020/hbase
No comments:
Post a Comment