From 5ca140fe2fedede92ce9f6ebf6becc8c88a74bb9 Mon Sep 17 00:00:00 2001 From: jyates Date: Thu, 4 Apr 2013 20:45:25 +0000 Subject: [PATCH] HBASE-7817: Suggested JDWP debug options in hbase-env.sh are wrong (Vasu Mariyala) git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1464736 13f79535-47bb-0310-9956-ffa450edef68 --- bin/hbase-config.sh | 4 +++- bin/hbase-daemon.sh | 8 +++++--- conf/hbase-env.sh | 31 +++++++++++++++++++++---------- 3 files changed, 29 insertions(+), 14 deletions(-) diff --git a/bin/hbase-config.sh b/bin/hbase-config.sh index 6a1cd9b1485..0300fc5ca33 100644 --- a/bin/hbase-config.sh +++ b/bin/hbase-config.sh @@ -94,8 +94,10 @@ if [ -z "$HBASE_REST_OPTS" ]; then fi # Source the hbase-env.sh. Will have JAVA_HOME defined. -if [ -f "${HBASE_CONF_DIR}/hbase-env.sh" ]; then +# HBASE-7817 - Source the hbase-env.sh only if it has not already been done. HBASE_ENV_INIT keeps track of it. +if [ -z "$HBASE_ENV_INIT" ] && [ -f "${HBASE_CONF_DIR}/hbase-env.sh" ]; then . "${HBASE_CONF_DIR}/hbase-env.sh" + export HBASE_ENV_INIT="true" fi # Set default value for regionserver uid if not present diff --git a/bin/hbase-daemon.sh b/bin/hbase-daemon.sh index 70ead10fd8c..e45054b5ac7 100755 --- a/bin/hbase-daemon.sh +++ b/bin/hbase-daemon.sh @@ -153,9 +153,11 @@ pid=$HBASE_PID_DIR/hbase-$HBASE_IDENT_STRING-$command.pid export HBASE_ZNODE_FILE=$HBASE_PID_DIR/hbase-$HBASE_IDENT_STRING-$command.znode export HBASE_START_FILE=$HBASE_PID_DIR/hbase-$HBASE_IDENT_STRING-$command.autorestart - -if [ "$HBASE_USE_GC_LOGFILE" = "true" ]; then - export HBASE_GC_OPTS=" -Xloggc:${loggc}" +if [ -n "$SERVER_GC_OPTS" ]; then + export SERVER_GC_OPTS=${SERVER_GC_OPTS/"-Xloggc:"/"-Xloggc:${loggc}"} +fi +if [ -n "$CLIENT_GC_OPTS" ]; then + export CLIENT_GC_OPTS=${CLIENT_GC_OPTS/"-Xloggc:"/"-Xloggc:${loggc}"} fi # Set default scheduling priority diff --git a/conf/hbase-env.sh b/conf/hbase-env.sh index c37c4dae3e7..91aca76334f 100644 --- a/conf/hbase-env.sh +++ b/conf/hbase-env.sh @@ -40,20 +40,31 @@ # see http://wiki.apache.org/hadoop/PerformanceTuning export HBASE_OPTS="-XX:+UseConcMarkSweepGC" -# Uncomment below to enable java garbage collection logging for the server-side processes -# this enables basic gc logging for the server processes to the .out file -# export SERVER_GC_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps $HBASE_GC_OPTS" +# Uncomment one of the below three options to enable java garbage collection logging for the server-side processes. -# this enables gc logging using automatic GC log rolling. Only applies to jdk 1.6.0_34+ and 1.7.0_2+. Either use this set of options or the one above -# export SERVER_GC_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=1 -XX:GCLogFileSize=512M $HBASE_GC_OPTS" +# This enables basic gc logging to the .out file. +# export SERVER_GC_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps" -# Uncomment below to enable java garbage collection logging for the client processes in the .out file. -# export CLIENT_GC_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps $HBASE_GC_OPTS" +# This enables basic gc logging to its own file. +# If FILE-PATH is not replaced, the log file(.gc) would still be generated in the HBASE_LOG_DIR . +# export SERVER_GC_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:" -# Uncomment below (along with above GC logging) to put GC information in its own logfile (will set HBASE_GC_OPTS). -# This applies to both the server and client GC options above -# export HBASE_USE_GC_LOGFILE=true +# This enables basic GC logging to its own file with automatic log rolling. Only applies to jdk 1.6.0_34+ and 1.7.0_2+. +# If FILE-PATH is not replaced, the log file(.gc) would still be generated in the HBASE_LOG_DIR . +# export SERVER_GC_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc: -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=1 -XX:GCLogFileSize=512M" +# Uncomment one of the below three options to enable java garbage collection logging for the client processes. + +# This enables basic gc logging to the .out file. +# export CLIENT_GC_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps" + +# This enables basic gc logging to its own file. +# If FILE-PATH is not replaced, the log file(.gc) would still be generated in the HBASE_LOG_DIR . +# export CLIENT_GC_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:" + +# This enables basic GC logging to its own file with automatic log rolling. Only applies to jdk 1.6.0_34+ and 1.7.0_2+. +# If FILE-PATH is not replaced, the log file(.gc) would still be generated in the HBASE_LOG_DIR . +# export CLIENT_GC_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc: -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=1 -XX:GCLogFileSize=512M" # Uncomment below if you intend to use the EXPERIMENTAL off heap cache. # export HBASE_OPTS="$HBASE_OPTS -XX:MaxDirectMemorySize="