Skip to content

Commit 9e701bb

Browse files
javierlucaJavier
authored andcommitted
HBOPS-25594 Make easier to use graceful_stop on localhost mode (#3054)
Co-authored-by: Javier <[email protected]>
1 parent 150e02e commit 9e701bb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

bin/graceful_stop.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ moving regions"
3333
echo " maxthreads xx Limit the number of threads used by the region mover. Default value is 1."
3434
echo " movetimeout xx Timeout for moving regions. If regions are not moved by the timeout value,\
3535
exit with error. Default value is INT_MAX."
36-
echo " hostname Hostname of server we are to stop"
36+
echo " hostname Hostname to stop; match what HBase uses; pass 'localhost' if local to avoid ssh"
3737
echo " e|failfast Set -e so exit immediately if any command exits with non-zero status"
3838
echo " nob|nobalancer Do not manage balancer states. This is only used as optimization in \
3939
rolling_restart.sh to avoid multiple calls to hbase shell"
@@ -108,6 +108,10 @@ localhostname=`/bin/hostname -f`
108108
if [ "$localhostname" == "$hostname" ]; then
109109
local=true
110110
fi
111+
if [ "$localhostname" == "$hostname" ] || [ "$hostname" == "localhost" ]; then
112+
local=true
113+
hostname=$localhostname
114+
fi
111115

112116
if [ "$nob" == "true" ]; then
113117
log "[ $0 ] skipping disabling balancer -nob argument is used"

0 commit comments

Comments
 (0)