hbase好像一直存在这种问题:
思路:
删除hdfs regionID、删除meta表的region指向.
删除hdfs
- #!/bin/sh
- if [ $# -lt 3 ] ; then
- echo "please input 3 parameter[file_name_path、hadoop_path、input_path]"
- exit
- else
- cat $1 | while read row
- do
- regionpath=`echo "$row" | awk -F '.' '{print $2}'`
- table=`echo "$row" | awk -F ',' '{print $1}'`
- #删除hdfs的region
- if [ -z $table ] ; then
- echo "table is null"
- exit;
- fi
-
- if [ -z $regionpath ] ; then
- echo "regionpath is null"
- exit;
- fi
-
- cd $2
- ./hadoop fs -rmr /hbase/$table/$regionpath
- #删除meta表的region
- echo "deleteall '.META.','$row'">>$3
- echo "$regionpath"
- done
- fi
复制代码
删除meta
- #!/bin/sh
- if [ $# -lt 2 ] ; then
- echo "please input 2 parameter[hbase_path、file_path]"
- exit
- else
- if [ -z $1 ] ; then
- echo " hbase_path is null!!!"
- exit
- fi
-
- if [ -z $2 ] ; then
- echo " file_path is null!!!"
- exit
- fi
- cd $1
- ./hbase shell< $2
- fi
- ~
复制代码
|