From 6d56ecfcf7d7aa3a525076108c061455b5b5bb05 Mon Sep 17 00:00:00 2001 From: Enis Soztutar Date: Tue, 26 Jan 2016 14:43:24 -0800 Subject: [PATCH] HBASE-15145 HBCK and Replication should authenticate to zookepeer using server principal --- bin/hbase | 9 +++++++++ bin/hbase-config.sh | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/bin/hbase b/bin/hbase index f4722ac8bf7..7901033950c 100755 --- a/bin/hbase +++ b/bin/hbase @@ -77,6 +77,7 @@ if [ $# = 0 ]; then echo "Options:" echo " --config DIR Configuration direction to use. Default: ./conf" echo " --hosts HOSTS Override the list in 'regionservers' file" + echo " --auth-as-server Authenticate to ZooKeeper using servers configuration" echo "" echo "Commands:" echo "Some commands take arguments. Pass no args or -h for usage." @@ -281,6 +282,14 @@ else HBASE_OPTS="$HBASE_OPTS $CLIENT_GC_OPTS" fi +if [ "$AUTH_AS_SERVER" == "true" ] || [ "$COMMAND" = "hbck" ]; then + if [ -n "$HBASE_SERVER_JAAS_OPTS" ]; then + HBASE_OPTS="$HBASE_OPTS $HBASE_SERVER_JAAS_OPTS" + else + HBASE_OPTS="$HBASE_OPTS $HBASE_REGIONSERVER_OPTS" + fi +fi + # figure out which class to run if [ "$COMMAND" = "shell" ] ; then # eg export JRUBY_HOME=/usr/local/share/jruby diff --git a/bin/hbase-config.sh b/bin/hbase-config.sh index c113adb522b..d7d7e6fdc91 100644 --- a/bin/hbase-config.sh +++ b/bin/hbase-config.sh @@ -61,6 +61,11 @@ do hosts=$1 shift HBASE_REGIONSERVERS=$hosts + elif [ "--auth-as-server" = "$1" ] + then + shift + # shellcheck disable=SC2034 + AUTH_AS_SERVER="true" else # Presume we are at end of options and break break