Skip to content

Commit f8ba9b3

Browse files
authored
HBASE-26146: Add support for HBASE_HBCK_OPTS (#3537)
Signed-off-by: stack <[email protected]>
1 parent 4ec1333 commit f8ba9b3

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

bin/hbase

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@
5454
# HBASE_SHELL_OPTS Extra options passed to the hbase shell.
5555
# Empty by default.
5656
#
57+
# HBASE_HBCK_OPTS Extra options passed to hbck.
58+
# Defaults to HBASE_SERVER_JAAS_OPTS if specified, or HBASE_REGIONSERVER_OPTS.
5759
bin=`dirname "$0"`
5860
bin=`cd "$bin">/dev/null; pwd`
5961

@@ -423,12 +425,18 @@ else
423425
HBASE_OPTS="$HBASE_OPTS $CLIENT_GC_OPTS"
424426
fi
425427

426-
if [ "$AUTH_AS_SERVER" == "true" ] || [ "$COMMAND" = "hbck" ]; then
427-
if [ -n "$HBASE_SERVER_JAAS_OPTS" ]; then
428-
HBASE_OPTS="$HBASE_OPTS $HBASE_SERVER_JAAS_OPTS"
429-
else
430-
HBASE_OPTS="$HBASE_OPTS $HBASE_REGIONSERVER_OPTS"
431-
fi
428+
if [ -n "$HBASE_SERVER_JAAS_OPTS" ]; then
429+
AUTH_AS_SERVER_OPTS="$HBASE_SERVER_JAAS_OPTS"
430+
else
431+
AUTH_AS_SERVER_OPTS="$HBASE_REGIONSERVER_OPTS"
432+
fi
433+
434+
if [ "$AUTH_AS_SERVER" == "true" ]; then
435+
HBASE_OPTS="$HBASE_OPTS $AUTH_AS_SERVER_OPTS"
436+
elif [ -z "$HBASE_HBCK_OPTS" ]; then
437+
# The default for hbck should be to use auth-as-server args, for compatibility
438+
# with HBASE-15145
439+
HBASE_HBCK_OPTS="$AUTH_AS_SERVER_OPTS"
432440
fi
433441

434442
# check if the command needs jline
@@ -545,6 +553,7 @@ elif [ "$COMMAND" = "hbck" ] ; then
545553
CLASS='org.apache.hadoop.hbase.util.HBaseFsck'
546554
;;
547555
esac
556+
HBASE_OPTS="$HBASE_OPTS $HBASE_HBCK_OPTS"
548557
elif [ "$COMMAND" = "wal" ] ; then
549558
CLASS='org.apache.hadoop.hbase.wal.WALPrettyPrinter'
550559
elif [ "$COMMAND" = "hfile" ] ; then

0 commit comments

Comments
 (0)