脚本主要是方便自己工作使用,服务器环境中配置了hbase相关环境变量
1.hbase备份脚本
#!/bin/bashtableList=("table1" "table2" "table3" "table4" "table5")for table in ${tableList[@]}
do
hbase org.apache.hadoop.hbase.mapreduce.Export $table /user/dw_hbkal/przhang/hbasebak/$table;echo "$table success done"
done
2. hbase清表脚本
#!/bin/bashtableList=("table1","table2","table3","table4","table5" )for table in ${tableList[@]}
do
echo "truncate '$table'" | hbase shell
done