Author: nspiegelberg
Date: Tue Oct 11 02:02:17 2011
New Revision: 1181365
URL: http://svn.apache.org/viewvc?rev=1181365&view=rev
Log:
Fix location of gc-hbase.log in clusters; rotate the log on process restart
Summary:
#1. gc-hbase.log is set up to go to $HBASE_HOME/logs.
This is ok for local HBase setup, but this dir doesn't exist in our cluster
setup.
As a result, the gc output was ending up in the *.out (stdout) file, instead of
gc-hbase.log.
In the cluster setup, the logs live in /usr/local/hadoop/logs/<CELLNAME>-HBASE.
So fixed the config to use the above location.
#2. Also added *.out file like log rotation for the gc-hbase.log. Without this,
every time the master or region server is restarted, we lose the old contents of
gc-hbase.log as java does not append to existing file but creates a new one.
With the change, the old file will get moved to gc-hbase.log.1, .2, etc.
Test Plan:
Pushed to cluster, and made sure gc-hbase.log ended up in
/usr/local/hadoop/HBASE.
And that on on a restart, the old log got rotated out to a .1 file.
DiffCamp Revision: 152433
Reviewed By: pkhaitan
CC: pkhaitan, hbase@lists
Revert Plan:
OK
Modified:
hbase/branches/0.89/bin/hbase-config.sh
hbase/branches/0.89/bin/hbase-daemon.sh
hbase/branches/0.89/conf/hbase-env.sh
Modified: hbase/branches/0.89/bin/hbase-config.sh
URL:
http://svn.apache.org/viewvc/hbase/branches/0.89/bin/hbase-config.sh?rev=1181365&r1=1181364&r2=1181365&view=diff
==============================================================================
--- hbase/branches/0.89/bin/hbase-config.sh (original)
+++ hbase/branches/0.89/bin/hbase-config.sh Tue Oct 11 02:02:17 2011
@@ -125,7 +125,8 @@ HBASE_ZOOKEEPER_JMX_OPTS="$HBASE_JMX_OPT
# export LD_LIBRARY_PATH=/usr/local/hadoop/:$LD_LIBRARY_PATH
HBASE_YOURKIT_PROFILE="-agentlib:yjpagent"
-HBASE_GC_OPTIONS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps
-Xloggc:$HBASE_HOME/logs/gc-hbase.log"
+HBASE_GC_LOG=$HBASE_LOG_DIR/gc-hbase.log
+HBASE_GC_OPTIONS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps
-Xloggc:$HBASE_GC_LOG"
HBASE_MASTER_JDWP_OPTIONS="-Xdebug
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8070"
HBASE_REGIONSERVER_JDWP_OPTIONS="-Xdebug
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8071"
Modified: hbase/branches/0.89/bin/hbase-daemon.sh
URL:
http://svn.apache.org/viewvc/hbase/branches/0.89/bin/hbase-daemon.sh?rev=1181365&r1=1181364&r2=1181365&view=diff
==============================================================================
--- hbase/branches/0.89/bin/hbase-daemon.sh (original)
+++ hbase/branches/0.89/bin/hbase-daemon.sh Tue Oct 11 02:02:17 2011
@@ -137,6 +137,8 @@ case $startStop in
fi
hbase_rotate_log $logout
+ hbase_rotate_log $HBASE_GC_LOG
+
echo starting $command, logging to $logout
# Add to the command log file vital stats on our environment.
echo "`date` Starting $command on `hostname`" >> $loglog
Modified: hbase/branches/0.89/conf/hbase-env.sh
URL:
http://svn.apache.org/viewvc/hbase/branches/0.89/conf/hbase-env.sh?rev=1181365&r1=1181364&r2=1181365&view=diff
==============================================================================
--- hbase/branches/0.89/conf/hbase-env.sh (original)
+++ hbase/branches/0.89/conf/hbase-env.sh Tue Oct 11 02:02:17 2011
@@ -56,7 +56,7 @@ export HBASE_OPTS="-XX:+HeapDumpOnOutOfM
# export HBASE_SSH_OPTS="-o ConnectTimeout=1 -o SendEnv=HBASE_CONF_DIR"
# Where log files are stored. $HBASE_HOME/logs by default.
-# export HBASE_LOG_DIR=${HBASE_HOME}/logs
+export HBASE_LOG_DIR=${HBASE_HOME}/logs
# A string representing this instance of hbase. $USER by default.
# export HBASE_IDENT_STRING=$USER