首页 > 代码库 > hbase删除region块的脚本

hbase删除region块的脚本

删除hbase表region块脚本

  1. 文件hua.txt格式:
  2. CHAT_INFO,1318153079100530000314050,1318173760068.991ca04ff164c3f7987a9d93e0f744f5.
  3. CHAT_INFO,1318156265075530000260366,1318173760068.2e9ac5a34869209f95ab46bf72061fd6.
  4. CHAT_INFO,1318158690100530000063285,1318176690151.dfe4ec67087d58daa1d15e014fa3bbf0.
  5. deleteregioninmeta.sh删除hdfs的region以及.META.表中的region信息,内容如下:
  6. !#/bin/bash
  7. while read line
  8. do
  9. #        echo "$line"
  10. regionpath=/hbase/$1/`echo "$line" | awk -F ‘.‘ ‘{print $2}‘`
  11. echo "$regionpath" 
  12. hadoop fs -mv  $regionpath /hua/chat_info_bak
  13. echo "deleteall ‘.META.‘,‘$line‘" | hbase shell
  14. done < $2
  15. 执行命令:sh deleteregioninmeta.sh CHAT_INFO  /home/hadoop/hua/hua.txt
复制代码

 

hbase删除region块的脚本