#!/bin/bash
TMP_FILE=tmp_groups
GROUPS_FILE=groups.txt
echo "list_groups" | hbase shell > tmp_groups
sleep 2
sed '1,6d' $TMP_FILE | tac | sed '1,2d' | tac > $GROUPS_FILE
sleep 2
for group in $(cat $GROUPS_FILE);
do
echo "balance_group '$group'" | hbase shell
echo "'$group' balancer successful !!! will go next group "
sleep 30
done