趴网上找了半天没找到备份hbase表结构的操作,只好自己动手,用shell写一句
echo -e "list\nexit" | hbase shell \
| awk '/TABLE/,/ row/' | grep -vE "TABLE| row\(s\)" \
| while read TABLE;do echo -e "describe '${TABLE}'\nexit" | hbase shell | tee -a hbase_tbl_dsc`date +%Y%m%d%`.txt;done
执行结果:
在当前目录下生成文件 hbase_tbl_dsc`date +%Y%m%d%`.txt