Home  >  Article  >  Database  >  HBase强制删除一个表

HBase强制删除一个表

WBOY
WBOYOriginal
2016-06-07 17:27:202007browse

HBase强制删除一个表,强制删除该表在hdfs上的所有文件(路径根据实际情况而定):

情景:

由于内网测试环境hbase并没有安装“SNAPPY”压缩,而建表时执行了

alter 'TrojanInfo', {NAME => 'i', COMPRESSION => 'SNAPPY'}

强制删除表:

1、强制删除该表在hdfs上的所有文件(路径根据实际情况而定):

./Hadoop fs -rmr /hbase/TrojanInfo

2、删除该表在HBase系统表.META.中的记录:

A、首先从.META.中查询出表 TrojanInfo在.META.中的rowkey,这可以通过scan '.META.',然后手动筛选;

B、然后删除该rowkey下的3个字段(假设查询出的rowkey为TrojanInfo,,1361433390076.2636b5a2b3d3d08f23d2af9582f29bd8.)

delete 'TrojanInfo','TrojanInfo,,1361433390076.2636b5a2b3d3d08f23d2af9582f29bd8.','info:server'

delete 'TrojanInfo','TrojanInfo,,1361433390076.2636b5a2b3d3d08f23d2af9582f29bd8.','info:serverstartcode'

delete 'TrojanInfo','TrojanInfo,,1361433390076.2636b5a2b3d3d08f23d2af9582f29bd8.','info:regioninfo'

C、重启hbase即可删除表 TrojanInfo

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn