HBase强制删除一个表
HBase强制删除一个表
情景: www.zzzyk.com
由于内网测试环境hbase并没有安装“SNAPPY”压缩,而建表时执行了
[plain]
alter 'TrojanInfo', {NAME => 'i', COMPRESSION => 'SNAPPY'}
强制删除表:
1、强制删除该表在hdfs上的所有文件(路径根据实际情况而定):
[sql]
./hadoop fs -rmr /hbase/TrojanInfo
www.zzzyk.com
2、删除该表在HBase系统表.META.中的记录:
A、首先从.META.中查询出表 TrojanInfo在.META.中的rowkey,这可以
通过scan '.META.',然后手动筛选;
通过scan '.META.',然后手动筛选;
B、然后删除该rowkey下的3个字段(假设查询出的rowkey为TrojanInfo,,1361433390076.2636b5a2b3d3d08f23d2af9582f29bd8.)
[plain]
delete 'TrojanInfo','TrojanInfo,,1361433390076.2636b5a2b3d3d08f
23d2af9582f29bd8.','info:server'
23d2af9582f29bd8.','info:server'
delete 'TrojanInfo','TrojanInfo,,1361433390076.2636b5a2b3d3d08f
23d2af9582f29bd8.','info:serverstartcode'
23d2af9582f29bd8.','info:serverstartcode'
delete 'TrojanInfo','TrojanInfo,,1361433390076.2636b5a2b3d3d08f
23d2af9582f29bd8.','info:regioninfo'
23d2af9582f29bd8.','info:regioninfo'
C、重启hbase即可删除表 TrojanInfo