From a279c5e197f9a1696f116b28053448f17c28d721 Mon Sep 17 00:00:00 2001 From: Samir Ahmic Date: Thu, 1 Oct 2015 19:00:11 +0200 Subject: [PATCH] HBASE-14523 rolling-restart.sh --graceful will start regionserver process on master node --- bin/rolling-restart.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/bin/rolling-restart.sh b/bin/rolling-restart.sh index b3ac67f..fb43967 100755 --- a/bin/rolling-restart.sh +++ b/bin/rolling-restart.sh @@ -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 -- 2.1.4