commit 87b0f029ffdaa64202c3ac20f40e911ba2e929ef Author: nspiegelberg Date: 23 minutes ago HBASE-4761 Add Developer Debug Options to HBase Config diff --git a/bin/hbase-daemon.sh b/bin/hbase-daemon.sh index 2979243..7a96e67 100755 --- a/bin/hbase-daemon.sh +++ b/bin/hbase-daemon.sh @@ -114,12 +114,18 @@ if [ "$JAVA_HOME" = "" ]; then exit 1 fi JAVA=$JAVA_HOME/bin/java -export HBASE_LOGFILE=hbase-$HBASE_IDENT_STRING-$command-$HOSTNAME.log +export HBASE_LOG_PREFIX=hbase-$HBASE_IDENT_STRING-$command-$HOSTNAME +export HBASE_LOGFILE=$HBASE_LOG_PREFIX.log export HBASE_ROOT_LOGGER="INFO,DRFA" -logout=$HBASE_LOG_DIR/hbase-$HBASE_IDENT_STRING-$command-$HOSTNAME.out +logout=$HBASE_LOG_DIR/$HBASE_LOG_PREFIX.out +loggc=$HBASE_LOG_DIR/$HBASE_LOG_PREFIX.gc loglog="${HBASE_LOG_DIR}/${HBASE_LOGFILE}" pid=$HBASE_PID_DIR/hbase-$HBASE_IDENT_STRING-$command.pid +if [ "$HBASE_USE_GC_LOGFILE" = "true" ]; then + export HBASE_GC_OPTS=" -Xloggc:${loggc}" +fi + # Set default scheduling priority if [ "$HBASE_NICENESS" = "" ]; then export HBASE_NICENESS=0 @@ -137,6 +143,7 @@ case $startStop in fi hbase_rotate_log $logout + hbase_rotate_log $loggc echo starting $command, logging to $logout # Add to the command log file vital stats on our environment. echo "`date` Starting $command on `hostname`" >> $loglog diff --git a/bin/stop-hbase.sh b/bin/stop-hbase.sh index 73ca7c1..b382834 100755 --- a/bin/stop-hbase.sh +++ b/bin/stop-hbase.sh @@ -39,8 +39,9 @@ if [ "$HBASE_IDENT_STRING" = "" ]; then export HBASE_IDENT_STRING="$USER" fi -export HBASE_LOGFILE=hbase-$HBASE_IDENT_STRING-master-$HOSTNAME.log -logout=$HBASE_LOG_DIR/hbase-$HBASE_IDENT_STRING-master-$HOSTNAME.out +export HBASE_LOG_PREFIX=hbase-$HBASE_IDENT_STRING-master-$HOSTNAME +export HBASE_LOGFILE=$HBASE_LOG_PREFIX.log +logout=$HBASE_LOG_DIR/$HBASE_LOG_PREFIX.out loglog="${HBASE_LOG_DIR}/${HBASE_LOGFILE}" pid=${HBASE_PID_DIR:-/tmp}/hbase-$HBASE_IDENT_STRING-master.pid diff --git a/conf/hbase-env.sh b/conf/hbase-env.sh index 2d55d27..0de1bbb 100644 --- a/conf/hbase-env.sh +++ b/conf/hbase-env.sh @@ -37,17 +37,20 @@ export HBASE_OPTS="-ea -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode" # Uncomment below to enable java garbage collection logging in the .out file. -# export HBASE_OPTS="$HBASE_OPTS -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps" +# export HBASE_OPTS="$HBASE_OPTS -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps $HBASE_GC_OPTS" + +# Uncomment below (along with above GC logging) to put GC information in its own logfile (will set HBASE_GC_OPTS) +# export HBASE_USE_GC_LOGFILE=true # Uncomment and adjust to enable JMX exporting # See jmxremote.password and jmxremote.access in $JRE_HOME/lib/management to configure remote password access. # More details at: http://java.sun.com/javase/6/docs/technotes/guides/management/agent.html # # export HBASE_JMX_BASE="-Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false" -# export HBASE_MASTER_OPTS="$HBASE_JMX_BASE -Dcom.sun.management.jmxremote.port=10101" -# export HBASE_REGIONSERVER_OPTS="$HBASE_JMX_BASE -Dcom.sun.management.jmxremote.port=10102" -# export HBASE_THRIFT_OPTS="$HBASE_JMX_BASE -Dcom.sun.management.jmxremote.port=10103" -# export HBASE_ZOOKEEPER_OPTS="$HBASE_JMX_BASE -Dcom.sun.management.jmxremote.port=10104" +# export HBASE_MASTER_OPTS="$HBASE_MASTER_OPTS $HBASE_JMX_BASE -Dcom.sun.management.jmxremote.port=10101" +# export HBASE_REGIONSERVER_OPTS="$HBASE_REGIONSERVER_OPTS $HBASE_JMX_BASE -Dcom.sun.management.jmxremote.port=10102" +# export HBASE_THRIFT_OPTS="$HBASE_THRIFT_OPTS $HBASE_JMX_BASE -Dcom.sun.management.jmxremote.port=10103" +# export HBASE_ZOOKEEPER_OPTS="$HBASE_ZOOKEEPER_OPTS $HBASE_JMX_BASE -Dcom.sun.management.jmxremote.port=10104" # File naming hosts on which HRegionServers will run. $HBASE_HOME/conf/regionservers by default. # export HBASE_REGIONSERVERS=${HBASE_HOME}/conf/regionservers @@ -58,6 +61,12 @@ export HBASE_OPTS="-ea -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode" # Where log files are stored. $HBASE_HOME/logs by default. # export HBASE_LOG_DIR=${HBASE_HOME}/logs +# Enable remote JDWP debugging of major HBase processes. Meant for Core Developers +# export HBASE_MASTER_OPTS="$HBASE_MASTER_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8070" +# export HBASE_REGIONSERVER_OPTS="$HBASE_REGIONSERVER_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8071" +# export HBASE_THRIFT_OPTS="$HBASE_THRIFT_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8072" +# export HBASE_ZOOKEEPER_OPTS="$HBASE_ZOOKEEPER_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8073" + # A string representing this instance of hbase. $USER by default. # export HBASE_IDENT_STRING=$USER