From a8e99cef5ea6bd2b67371e8ffbd7a11ead6162b3 Mon Sep 17 00:00:00 2001 From: Umesh Agashe Date: Mon, 26 Mar 2018 12:10:27 -0700 Subject: [PATCH] HBASE-20130 Use defaults (16020 & 16030) as base ports when the RS is bound to localhost Base ports are changed to defaults 16020 & 16030 when RS binds to localhost. This is mostly used in pseudo distributed mode. --- bin/local-regionservers.sh | 10 +++++++--- bin/regionservers.sh | 4 ++-- src/main/asciidoc/_chapters/getting_started.adoc | 8 ++++---- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/bin/local-regionservers.sh b/bin/local-regionservers.sh index 40ba93eb9199ac1bc19e2171bbe6179c1a236f2a..79dc5d05e2d8b145b634dd4d61b9fcda79ce08de 100755 --- a/bin/local-regionservers.sh +++ b/bin/local-regionservers.sh @@ -18,7 +18,11 @@ # */ # This is used for starting multiple regionservers on the same machine. # run it from hbase-dir/ just like 'bin/hbase' -# Supports up to 100 regionservers (limitation = overlapping ports) +# Supports up to 10 regionservers (limitation = overlapping ports) +# For supporting more instances select different values (e.g. 16200, 16300) +# for HBASE_RS_BASE_PORT and HBASE_RS_INFO_BASE_PORT below +HBASE_RS_BASE_PORT=16020 +HBASE_RS_INFO_BASE_PORT=16030 bin=`dirname "${BASH_SOURCE-$0}"` bin=`cd "$bin" >/dev/null && pwd` @@ -44,8 +48,8 @@ run_regionserver () { DN=$2 export HBASE_IDENT_STRING="$USER-$DN" HBASE_REGIONSERVER_ARGS="\ - -Dhbase.regionserver.port=`expr 16200 + $DN` \ - -Dhbase.regionserver.info.port=`expr 16300 + $DN`" + -Dhbase.regionserver.port=`expr $HBASE_RS_BASE_PORT + $DN` \ + -Dhbase.regionserver.info.port=`expr $HBASE_RS_INFO_BASE_PORT + $DN`" "$bin"/hbase-daemon.sh --config "${HBASE_CONF_DIR}" \ --autostart-window-size "${AUTOSTART_WINDOW_SIZE}" \ diff --git a/bin/regionservers.sh b/bin/regionservers.sh index 6db11bb13236ff6d9c1c4ddc2068e08d62cdcc66..b83c1f3c79eba2e31acf16b6c55b07e3e4fe76a0 100755 --- a/bin/regionservers.sh +++ b/bin/regionservers.sh @@ -60,8 +60,8 @@ fi regionservers=`cat "$HOSTLIST"` if [ "$regionservers" = "localhost" ]; then HBASE_REGIONSERVER_ARGS="\ - -Dhbase.regionserver.port=16201 \ - -Dhbase.regionserver.info.port=16301" + -Dhbase.regionserver.port=16020 \ + -Dhbase.regionserver.info.port=16030" $"${@// /\\ }" ${HBASE_REGIONSERVER_ARGS} \ 2>&1 | sed "s/^/$regionserver: /" & diff --git a/src/main/asciidoc/_chapters/getting_started.adoc b/src/main/asciidoc/_chapters/getting_started.adoc index 2fdb94964a2ebd5dd919dbec3d7e8b2ce79c5251..dae3688203d9b3da046e3cc5a6e1b8af5afcdf62 100644 --- a/src/main/asciidoc/_chapters/getting_started.adoc +++ b/src/main/asciidoc/_chapters/getting_started.adoc @@ -410,10 +410,10 @@ Running multiple HRegionServers on the same system can be useful for testing in The `local-regionservers.sh` command allows you to run multiple RegionServers. It works in a similar way to the `local-master-backup.sh` command, in that each parameter you provide represents the port offset for an instance. Each RegionServer requires two ports, and the default ports are 16020 and 16030. -However, the base ports for additional RegionServers are not the default ports since the default ports are used by the HMaster, which is also a RegionServer since HBase version 1.0.0. -The base ports are 16200 and 16300 instead. -You can run 99 additional RegionServers that are not a HMaster or backup HMaster, on a server. -The following command starts four additional RegionServers, running on sequential ports starting at 16202/16302 (base ports 16200/16300 plus 2). +Since HBase version 1.1.0, HMaster doesn't use region server ports, this leaves 10 ports (16020 to 16029 and 16030 to 16039) to be used for RegionServers. +For supporting additional RegionServers, base ports can be changed in script 'local-regionservers.sh' to appropriate value. +e.g. With values 16200 and 16300 for base ports, 99 additional RegionServers can be supported, on a server. +The following command starts four additional RegionServers, running on sequential ports starting at 16022/16032 (base ports 16020/16030 plus 2). + ---- -- 2.16.1