From 3239b4030c74c075bcd60b18a7f82f6e2943f1bf Mon Sep 17 00:00:00 2001 From: LiangJun He <2005hithlj@163.com> Date: Fri, 5 Aug 2022 21:13:29 +0800 Subject: [PATCH 1/2] HBASE-27275 graceful_stop.sh unable to restore the balance state --- bin/graceful_stop.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/graceful_stop.sh b/bin/graceful_stop.sh index fc18239830b2..df34d3a2bb75 100755 --- a/bin/graceful_stop.sh +++ b/bin/graceful_stop.sh @@ -115,7 +115,7 @@ if [ "$nob" == "true" ]; then HBASE_BALANCER_STATE=false else log "Disabling load balancer" - HBASE_BALANCER_STATE=$(echo 'balance_switch false' | "$bin"/hbase --config "${HBASE_CONF_DIR}" shell -n | tail -1) + HBASE_BALANCER_STATE=$(echo 'balance_switch false' | "$bin"/hbase --config "${HBASE_CONF_DIR}" shell -n | tail -2 | head -1 | awk '{print $2}') log "Previous balancer state was $HBASE_BALANCER_STATE" fi From 3232a7e61bac00d785edd7a82b8fa2258cb93e19 Mon Sep 17 00:00:00 2001 From: LiangJun He <2005hithlj@163.com> Date: Mon, 8 Aug 2022 21:28:01 +0800 Subject: [PATCH 2/2] HBASE-27275 graceful_stop.sh unable to restore the balance state --- bin/graceful_stop.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/graceful_stop.sh b/bin/graceful_stop.sh index df34d3a2bb75..da3495b1d7bf 100755 --- a/bin/graceful_stop.sh +++ b/bin/graceful_stop.sh @@ -115,7 +115,7 @@ if [ "$nob" == "true" ]; then HBASE_BALANCER_STATE=false else log "Disabling load balancer" - HBASE_BALANCER_STATE=$(echo 'balance_switch false' | "$bin"/hbase --config "${HBASE_CONF_DIR}" shell -n | tail -2 | head -1 | awk '{print $2}') + HBASE_BALANCER_STATE=$(echo 'balance_switch false' | "$bin"/hbase --config "${HBASE_CONF_DIR}" shell -n | grep 'Previous balancer state' | awk -F": " '{print $2}') log "Previous balancer state was $HBASE_BALANCER_STATE" fi