hbase表重命名

来源:互联网 发布:狮王white牙膏知乎 编辑:程序博客网 时间:2024/06/02 20:48

    因为hbase中没有rename命令,所以更改表名比较复杂。重命名主要通过hbase的快照功能。

1.停止表继续插入

 hbase shell>disable 'tableName'

2。制作快照
hbase shell> snapshot 'tableName', 'tableSnapshot'

3.克隆快照为新的名字
hbase shell> clone_snapshot 'tableSnapshot', 'newTableName'

4.删除快照
hbase shell> delete_snapshot 'tableSnapshot'

5.删除原来表
hbase shell> drop 'tableName'