hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r656798 - /hadoop/hbase/trunk/bin/hbase-daemon.sh
Date Thu, 15 May 2008 19:22:55 GMT
Author: stack
Date: Thu May 15 12:22:54 2008
New Revision: 656798

URL: http://svn.apache.org/viewvc?rev=656798&view=rev
Log:
HBASE-558 Output hbase+hadoop+jvm version as well as java opts, ulimit, into master/regionserver
log on startup

Modified:
    hadoop/hbase/trunk/bin/hbase-daemon.sh

Modified: hadoop/hbase/trunk/bin/hbase-daemon.sh
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/bin/hbase-daemon.sh?rev=656798&r1=656797&r2=656798&view=diff
==============================================================================
--- hadoop/hbase/trunk/bin/hbase-daemon.sh (original)
+++ hadoop/hbase/trunk/bin/hbase-daemon.sh Thu May 15 12:22:54 2008
@@ -89,10 +89,21 @@
   export HBASE_IDENT_STRING="$USER"
 fi
 
-# some variables
+# Some variables
+# Work out java location so can print version into log.
+if [ "$JAVA_HOME" != "" ]; then
+  #echo "run java in $JAVA_HOME"
+  JAVA_HOME=$JAVA_HOME
+fi
+if [ "$JAVA_HOME" = "" ]; then
+  echo "Error: JAVA_HOME is not set."
+  exit 1
+fi
+JAVA=$JAVA_HOME/bin/java
 export HBASE_LOGFILE=hbase-$HBASE_IDENT_STRING-$command-$HOSTNAME.log
 export HBASE_ROOT_LOGGER="INFO,DRFA"
-log=$HBASE_LOG_DIR/hbase-$HBASE_IDENT_STRING-$command-$HOSTNAME.out  
+logout=$HBASE_LOG_DIR/hbase-$HBASE_IDENT_STRING-$command-$HOSTNAME.out  
+loglog="${HBASE_LOG_DIR}/${HBASE_LOGFILE}"
 pid=$HBASE_PID_DIR/hbase-$HBASE_IDENT_STRING-$command.pid
 
 # Set default scheduling priority
@@ -111,24 +122,30 @@
       fi
     fi
 
-    hbase_rotate_log $log
-    echo starting $command, logging to $log
+    hbase_rotate_log $logout
+    echo starting $command, logging to $logout
+    # Add to the command log file vital stats on our environment.
+    echo "`date` Starting $command on `hostname`" >> $loglog
+    $JAVA -version >> $loglog 2>&1
+    echo "ulimit -n `ulimit -n`" >> $loglog 2>&1
     nohup nice -n $HBASE_NICENESS "$HBASE_HOME"/bin/hbase \
         --config "${HBASE_CONF_DIR}" \
-        $command $startStop "$@" > "$log" 2>&1 < /dev/null &
+        $command $startStop "$@" > "$logout" 2>&1 < /dev/null &
     echo $! > $pid
-    sleep 1; head "$log"
+    sleep 1; head "$logout"
     ;;
 
   (stop)
     if [ -f $pid ]; then
       if kill -0 `cat $pid` > /dev/null 2>&1; then
         echo -n stopping $command
+        echo "`date` Stopping $command" >> $loglog
         if [ "$command" = "master" ]; then
           nohup nice -n $HBASE_NICENESS "$HBASE_HOME"/bin/hbase \
               --config "${HBASE_CONF_DIR}" \
-              $command $startStop "$@" > "$log" 2>&1 < /dev/null &
+              $command $startStop "$@" > "$logout" 2>&1 < /dev/null &
         else
+          echo "`date` Killing $command" >> $loglog
           kill `cat $pid` > /dev/null 2>&1
         fi
         while kill -0 `cat $pid` > /dev/null 2>&1; do



Mime
View raw message