HBase backup and restore
In this recipe, we will look at HBase backup and restore. We have discussed in the Namenode high availability section about the importance of backup, despite having HA. We will look at ways to take snapshots and restore it.
Getting ready
For this recipe, you must have completed the Setting up multi-node Hbase cluster recipe and have a basic understanding of the backup principles.
How to do it...
- Connect to the
master1.cyrus.com
HBase master node and switch to the userhadoop
. - Execute the following command to take a snapshot of a particular table. In this case, the table name is
test
:$ hbase snapshot create -n test_30march -t test
- To list the snapshots, connect the HBase shell as shown in the following screenshot:
- We can restore the snapshot using the following command—the table must be disabled for the restore:
hbase> disable 'test_30march' hbase> restore_snapshot 'test_30march'
- To clone the table, we can restore it to a new table....