删除hbase表region块脚本
- 文件hua.txt格式:
- CHAT_INFO,1318153079100530000314050,1318173760068.991ca04ff164c3f7987a9d93e0f744f5.
- CHAT_INFO,1318156265075530000260366,1318173760068.2e9ac5a34869209f95ab46bf72061fd6.
- CHAT_INFO,1318158690100530000063285,1318176690151.dfe4ec67087d58daa1d15e014fa3bbf0.
- deleteregioninmeta.sh删除hdfs的region以及.META.表中的region信息,内容如下:
- !#/bin/bash
- while read line
- do
- # echo "$line"
- regionpath=/hbase/$1/`echo "$line" | awk -F '.' '{print $2}'`
- echo "$regionpath"
- hadoop fs -mv $regionpath /hua/chat_info_bak
- echo "deleteall '.META.','$line'" | hbase shell
- done < $2
- 执行命令:sh deleteregioninmeta.sh CHAT_INFO /home/hadoop/hua/hua.txt