HBase provides snapshot functionality after 0.94, a snapshot is actually a set of metadata information that allows administrators to restore a table to a previous state. Snapshot is not a copy, it is simply a list of filenames and does not copy data. A full snapshot recovery thought you could roll back to the original table schema and create the data before the snapshot. The snapshot feature is turned on by default after 0.95, the previous version needs to manually turn on snapshot support, modify the Hbas-site.xml file to add
< Property > < name >hbase.snapshot.enabled</name> <value >true</value></ Property >
The following operations are provided primarily (this is done for a single table at this time):
#take snapshothbase> Snapshot'TableName','Snapshotname'#list snapshotshbase>list_snapshots #delete snapshothbase> Delete_snapshot'Snapshotname'#clone snapshothbase> Clone_snapshot'Src_snapshot','Dest_snapshot'#restore Snapshot, you must first disable the table out of HBase> Restore_snapshot'Snapshotname'
The problem of Practice
At present, our online cluster is hbase-0.94, open the snapshot function, practice a bit, have the following several questions:
- When metadata is in an inconsistent state, the general hbase will have transient metadata inconsistencies when it does split
- Need to do a restore when it will be the current state of the table to do a snapshot, after success will go to restore, this is a bit unnecessary, sometimes we just because the metadata inconsistent to do restore, so there will be no way to do
- Generate snapshot can only be a table a table to do, do not know the following HBase version will not be an operation to resolve all the table snapshot
Later plan to upgrade HBase, try a new version of snapshot will be more practical and reliable some.
HBase Snapshot Feature Introduction