HBASE-14523 rolling-restart.sh --graceful will start regionserver process on master node

This commit is contained in:
tedyu 2015-11-27 15:37:25 -08:00
parent 001eb0694a
commit 1c900e1721
1 changed files with 11 additions and 3 deletions

View File

@ -158,6 +158,8 @@ else
if [ $RR_GRACEFUL -eq 1 ]; then
# gracefully restart all online regionservers
masterport=`$bin/hbase org.apache.hadoop.hbase.util.HBaseConfTool hbase.master.port`
if [ "$masterport" == "null" ]; then masterport="16000"; fi
zkrs=`$bin/hbase org.apache.hadoop.hbase.util.HBaseConfTool zookeeper.znode.rs`
if [ "$zkrs" == "null" ]; then zkrs="rs"; fi
zkrs="$zparent/$zkrs"
@ -166,9 +168,15 @@ else
do
rs_parts=(${rs//,/ })
hostname=${rs_parts[0]}
echo "Gracefully restarting: $hostname"
"$bin"/graceful_stop.sh --config "${HBASE_CONF_DIR}" --restart --reload --debug --maxthreads "${RR_MAXTHREADS}" "$hostname"
sleep 1
port=${rs_parts[1]}
if [ "$port" -eq "$masterport" ]; then
echo "Skipping regionserver on master machine $hostname:$port"
continue
else
echo "Gracefully restarting: $hostname"
"$bin"/graceful_stop.sh --config "${HBASE_CONF_DIR}" --restart --reload --debug --maxthreads "${RR_MAXTHREADS}" "$hostname"
sleep 1
fi
done
fi
fi