This is an automated email from the ASF dual-hosted git repository.

alexey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit 0becb2484041210182afef511ced5f4a883075c8
Author: Attila Bukor <[email protected]>
AuthorDate: Thu Jan 6 18:34:24 2022 +0100

    [tool] Add --host to start_kudu.sh script
    
    The start_kudu.sh script currently works with an assumption that the
    Kudu servers will be accessed from the same host that they're running on
    (i.e. localhost).
    
    Recently, while running Kudu in a remote Linux box, I wanted to access
    it from my Mac, but the ports were bound to the loopback interface, so I
    wasn't able to do that. This change makes it possible to change what
    interface the servers bound to. To make sure the web server can be
    connected to from both a remote machine and from localhost, this patch
    also removes the --webserver_interface flag, which defaults to 0.0.0.0.
    
    Change-Id: I68f920a03f494d277b5f7008b0a75cd927634d9f
    Reviewed-on: http://gerrit.cloudera.org:8080/18127
    Tested-by: Kudu Jenkins
    Reviewed-by: Andrew Wong <[email protected]>
---
 src/kudu/scripts/start_kudu.sh | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/kudu/scripts/start_kudu.sh b/src/kudu/scripts/start_kudu.sh
index 37cef7f..c9a9d9a 100755
--- a/src/kudu/scripts/start_kudu.sh
+++ b/src/kudu/scripts/start_kudu.sh
@@ -40,6 +40,7 @@ start_kudu.sh [flags]
                     (default: system_unsync)
 -b, --builddir      Path to the Kudu build directory
 -c  --clusterdir    Path to place the Kudu masters and tablet servers.
+-H, --host          RPC address host (default: 127.0.0.1)
 -T, --tserver-flags Extra flags to be used on the tablet servers. Multiple
                     flags can be specified if wrapped in ""s.
 -M, --master-flags  Extra flags to be used on the master servers. Multiple
@@ -56,6 +57,7 @@ BUILDDIR=""
 CLUSTER_DIR="$PWD"
 EXTRA_TSERVER_FLAGS=""
 EXTRA_MASTER_FLAGS=""
+IP="127.0.0.1"
 
 while (( "$#" )); do
   case "$1" in
@@ -99,6 +101,10 @@ while (( "$#" )); do
       EXTRA_MASTER_FLAGS=$2
       shift 2
       ;;
+    -H|--host)
+      IP=$2
+      shift 2
+      ;;
     --) # end argument parsing
       shift
       break
@@ -138,7 +144,6 @@ KUDUMASTER="$BUILDDIR/bin/kudu-master"
 KUDUTSERVER="$BUILDDIR/bin/kudu-tserver"
 echo $KUDUMASTER
 echo $KUDUTSERVER
-IP=127.0.0.1
 
 [ ! -x "$KUDUMASTER" ] && { echo "Cannot find $KUDUMASTER executable";  exit 
1; }
 [ ! -x "$KUDUTSERVER" ] && { echo "Cannot find $KUDUTSERVER executable";  exit 
1; }
@@ -211,7 +216,6 @@ function start_master() {
   ARGS="$ARGS --time_source=$TIME_SOURCE"
   ARGS="$ARGS --unlock_unsafe_flags"
   ARGS="$ARGS --webserver_port=$HTTP_PORT"
-  ARGS="$ARGS --webserver_interface=$IP"
   if [ -d "$WEBSERVER_DOC_ROOT" ]; then
     ARGS="$ARGS --webserver_doc_root=$WEBSERVER_DOC_ROOT"
   fi
@@ -237,7 +241,6 @@ function start_tserver() {
   ARGS="$ARGS --time_source=$TIME_SOURCE"
   ARGS="$ARGS --unlock_unsafe_flags"
   ARGS="$ARGS --webserver_port=$HTTP_PORT"
-  ARGS="$ARGS --webserver_interface=$IP"
   ARGS="$ARGS --tserver_master_addrs=$4"
   if [ -d "$WEBSERVER_DOC_ROOT" ]; then
     ARGS="$ARGS --webserver_doc_root=$WEBSERVER_DOC_ROOT"

Reply via email to