HBASE-19784 bin/stop-hbase more friendly when hbase already stopped

Signed-off-by: Michael Stack <stack@apache.org>
This commit is contained in:
Mike Drob 2018-01-12 08:34:49 -06:00 committed by Michael Stack
parent af2d890055
commit 4476cc196c
No known key found for this signature in database
GPG Key ID: 9816C7FC8ACC93D2
1 changed files with 11 additions and 8 deletions

View File

@ -44,17 +44,20 @@ logout=$HBASE_LOG_DIR/$HBASE_LOG_PREFIX.out
loglog="${HBASE_LOG_DIR}/${HBASE_LOGFILE}"
pid=${HBASE_PID_DIR:-/tmp}/hbase-$HBASE_IDENT_STRING-master.pid
echo -n stopping hbase
echo "`date` Stopping hbase (via master)" >> $loglog
if [[ -e $pid ]]; then
echo -n stopping hbase
echo "`date` Stopping hbase (via master)" >> $loglog
nohup nice -n ${HBASE_NICENESS:-0} "$HBASE_HOME"/bin/hbase \
nohup nice -n ${HBASE_NICENESS:-0} "$HBASE_HOME"/bin/hbase \
--config "${HBASE_CONF_DIR}" \
master stop "$@" > "$logout" 2>&1 < /dev/null &
waitForProcessEnd `cat $pid` 'stop-master-command'
rm -f $pid
waitForProcessEnd `cat $pid` 'stop-master-command'
rm -f $pid
else
echo no hbase master found
fi
# distributed == false means that the HMaster will kill ZK when it exits
# HBASE-6504 - only take the first line of the output in case verbose gc is on