Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion bin/graceful_stop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ moving regions"
echo " maxthreads xx Limit the number of threads used by the region mover. Default value is 1."
echo " movetimeout xx Timeout for moving regions. If regions are not moved by the timeout value,\
exit with error. Default value is INT_MAX."
echo " hostname Hostname of server we are to stop"
echo " hostname Hostname to stop; match what HBase uses; pass 'localhost' if local to avoid ssh"
echo " e|failfast Set -e so exit immediately if any command exits with non-zero status"
echo " nob|nobalancer Do not manage balancer states. This is only used as optimization in \
rolling_restart.sh to avoid multiple calls to hbase shell"
Expand Down Expand Up @@ -108,6 +108,10 @@ localhostname=`/bin/hostname -f`
if [ "$localhostname" == "$hostname" ]; then
local=true
fi
if [ "$localhostname" == "$hostname" ] || [ "$hostname" == "localhost" ]; then
local=true
hostname=$localhostname
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my understanding, passing "localhost" to regionserver.sh is meant to be used in pseudo-distributed environments. See:

And it would use fixed ports:

if [ "$regionservers" = "localhost" ]; then
HBASE_REGIONSERVER_ARGS="\
-Dhbase.regionserver.port=16020 \
-Dhbase.regionserver.info.port=16030"

Since I want to avoid that, let me reassign hostname to the fqdn here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @javierluca . Thanks for digging in here.

Thanks for turning-up the 'overloading' of 'localhost'.

Above looks reasonable. Do we have to repeat the 'if [ "$localhostname" == "$hostname" ] ...' and the setting of local = true: i.e. do we need lines #108-110 in above now you've added #111-114?

Lets open new issue for this further discussion so we don't muddle JIRA+PR intent.

Thanks.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, on the ports for regionservers.sh, I think its just lazyness that they are hardcoded. Can change that in another issue.... Use HBASE_RS_BASE_PORT and HBASE_RS_INFO_BASE_PORT

Copy link
Contributor Author

@javierluca javierluca Mar 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have to repeat the 'if [ "$localhostname" == "$hostname" ] ...' and the setting of local = true

Ah no, that is my mistake. Sorry about that, we should remove the first check.

fi

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