- clone_snapshot
根据快照恢复一个宽表,恢复过程不涉及数据移动,可以在秒级完成。
hbase(main):003:0> help 'clone_snapshot'
Create a new table by cloning the snapshot content.
There're no copies of data involved.
And writing on the newly created table will not influence the snapshot data.
Examples:
hbase> clone_snapshot 'snapshotName', 'tableName'
hbase> clone_snapshot 'snapshotName', 'namespace:tableName'
Following command will restore all acl from origin snapshot table into the
newly created table.
hbase> clone_snapshot 'snapshotName', 'namespace:tableName', {RESTORE_ACL=>true}
- delete_all_snapshot
删除所有快照,支持正则。
hbase(main):004:0> help 'delete_all_snapshot'
Delete all of the snapshots matching the given regex. Examples:
hbase> delete_all_snapshot 's.*'
- delete_snapshot
删除指定快照。
hbase(main):005:0> help 'delete_snapshot'
Delete a specified snapshot. Examples:
hbase> delete_snapshot 'snapshotName',
- list_snapshots
列出所有的快照,支持*匹配。
hbase(main):006:0> help 'list_snapshots'
List all snapshots taken (by printing the names and relative information).
Optional regular expression parameter could be used to filter the output
by snapshot name.
Examples:
hbase> list_snapshots
hbase> list_snapshots 'abc.*'
- restore_snapshot
用于恢复指定快照,恢复过程会替代原有数据,将表恢复到快照点,快照之后的所有更新将会丢失。表必须disable.
hbase(main):007:0> help 'restore_snapshot'
Restore a specified snapshot.
The restore will replace the content of the original table,
bringing back the content to the snapshot state.
The table must be disabled.
Examples:
hbase> restore_snapshot 'snapshotName'
Following command will restore all acl from snapshot into the table.
hbase> restore_snapshot 'snapshotName', {RESTORE_ACL=>true}
- snapshot
为表打一个快照,但并不涉及数据移动。
hbase(main):008:0> help 'snapshot'
Take a snapshot of specified table. Examples:
hbase> snapshot 'sourceTable', 'snapshotName'
hbase> snapshot 'namespace:sourceTable', 'snapshotName', {SKIP_FLUSH => true}
- snapshot_all
为所有的表创建快照,快照名按系统规则生成,大约是这个样子:dalishen_ns_sep_test_zpb-ru-20191219
hbase(main):009:0> help 'snapshot_all'
List all tables and take snapshot .
Optional regular expression parameter could be used to filter the output
by table name.
Examples:
hbase> snapshot_all
hbase> snapshot_all 'abc.*'
- snapshot_restore
暂时不明
hbase(main):010:0> help 'snapshot_restore'
Use snapshot to restore tables.
Date parameter (in the form YYYY-mm-dd) is used to filter the snapshots
Examples:
hbase> snapshot_restore '2014-12-09'
- Snapshot 两阶段提交:1.acquired 2.reached/abort
原理:zk 3节点保证。
ls /${hbaserootdir}/online-snapshot
./acquired
./abort
./reached
网友评论