accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1399039 - /accumulo/trunk/bin/start-server.sh
Date Tue, 16 Oct 2012 23:13:37 GMT
Author: vines
Date: Tue Oct 16 23:13:37 2012
New Revision: 1399039

URL: http://svn.apache.org/viewvc?rev=1399039&view=rev
Log:
ACCUMULO-312 ACCUMULO-791 - Don't know how this was missed


Modified:
    accumulo/trunk/bin/start-server.sh

Modified: accumulo/trunk/bin/start-server.sh
URL: http://svn.apache.org/viewvc/accumulo/trunk/bin/start-server.sh?rev=1399039&r1=1399038&r2=1399039&view=diff
==============================================================================
--- accumulo/trunk/bin/start-server.sh (original)
+++ accumulo/trunk/bin/start-server.sh Tue Oct 16 23:13:37 2012
@@ -37,7 +37,9 @@ then
 fi
 SLAVES=`wc -l < ${ACCUMULO_HOME}/conf/slaves`
 
-if [ $HOST == localhost -o $HOST == "`hostname`" ] 
+ip=`ifconfig | grep inet[^6] | awk '{print $2}' | sed 's/addr://' | grep -v 0.0.0.0 | grep
-v 127.0.0.1 | head -n 1`
+
+if [ $HOST == localhost -o $HOST == "`hostname`" -o $HOST == "$ip" ] 
 then
   PID=`ps -ef | egrep ${ACCUMULO_HOME}/.*/accumulo.*.jar | grep "Main $SERVICE" | grep -v
grep | awk {'print $2'} | head -1`
 else
@@ -45,21 +47,21 @@ else
 fi
 
 if [ -z $PID ]; then
-    echo "Starting $LONGNAME on $HOST"
-    if [ $HOST == localhost  -o $HOST == "`hostname`" ] 
-    then
-       ${bin}/accumulo ${SERVICE} --address $1 >${ACCUMULO_LOG_DIR}/${SERVICE}_${LOGHOST}.out
2>${ACCUMULO_LOG_DIR}/${SERVICE}_${LOGHOST}.err & 
-       MAX_FILES_OPEN=`bash -c 'ulimit -n'`
-    else
-       $SSH $HOST "bash -c 'exec nohup ${bin}/accumulo ${SERVICE} --address $1 >${ACCUMULO_LOG_DIR}/${SERVICE}_${LOGHOST}.out
2>${ACCUMULO_LOG_DIR}/${SERVICE}_${LOGHOST}.err' &"
-       MAX_FILES_OPEN=`$SSH $HOST "bash -c 'ulimit -n'"` 
-    fi
+  echo "Starting $LONGNAME on $HOST"
+  if [ $HOST == localhost -o $HOST == "`hostname`" -o $HOST == "$ip" ] 
+  then
+    ${bin}/accumulo ${SERVICE} --address $1 >${ACCUMULO_LOG_DIR}/${SERVICE}_${LOGHOST}.out
2>${ACCUMULO_LOG_DIR}/${SERVICE}_${LOGHOST}.err & 
+    MAX_FILES_OPEN=`bash -c 'ulimit -n'`
+  else
+    $SSH $HOST "bash -c 'exec nohup ${bin}/accumulo ${SERVICE} --address $1 >${ACCUMULO_LOG_DIR}/${SERVICE}_${LOGHOST}.out
2>${ACCUMULO_LOG_DIR}/${SERVICE}_${LOGHOST}.err' &"
+    MAX_FILES_OPEN=`$SSH $HOST "bash -c 'ulimit -n'"` 
+  fi
 
-    if [ -n "$MAX_FILES_OPEN" ] && [ -n "$SLAVES" ] ; then
-       if [ "$SLAVES" -gt 10 ] && [ "$MAX_FILES_OPEN" -lt 65536 ]; then
-          echo "WARN : Max files open on $HOST is $MAX_FILES_OPEN, recommend 65536"
-       fi
+  if [ -n "$MAX_FILES_OPEN" ] && [ -n "$SLAVES" ] ; then
+    if [ "$SLAVES" -gt 10 ] && [ "$MAX_FILES_OPEN" -lt 65536 ]; then
+      echo "WARN : Max files open on $HOST is $MAX_FILES_OPEN, recommend 65536"
     fi
+  fi
 else
-    echo "$HOST : $LONGNAME already running (${PID})"
+  echo "$HOST : $LONGNAME already running (${PID})"
 fi



Mime
View raw message