accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1384111 - in /accumulo/branches/1.4: bin/ src/assemble/platform/debian/init.d/
Date Wed, 12 Sep 2012 20:32:01 GMT
Author: vines
Date: Wed Sep 12 20:32:01 2012
New Revision: 1384111

URL: http://svn.apache.org/viewvc?rev=1384111&view=rev
Log:
Updated init.d scripts to work for non-single node clusters.
Also no sshing to non-loopback ip for the host. Probably needs more loving


Modified:
    accumulo/branches/1.4/bin/start-server.sh
    accumulo/branches/1.4/src/assemble/platform/debian/init.d/accumulo-gc
    accumulo/branches/1.4/src/assemble/platform/debian/init.d/accumulo-master
    accumulo/branches/1.4/src/assemble/platform/debian/init.d/accumulo-monitor
    accumulo/branches/1.4/src/assemble/platform/debian/init.d/accumulo-slave
    accumulo/branches/1.4/src/assemble/platform/debian/init.d/accumulo-tracer

Modified: accumulo/branches/1.4/bin/start-server.sh
URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/bin/start-server.sh?rev=1384111&r1=1384110&r2=1384111&view=diff
==============================================================================
--- accumulo/branches/1.4/bin/start-server.sh (original)
+++ accumulo/branches/1.4/bin/start-server.sh Wed Sep 12 20:32:01 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

Modified: accumulo/branches/1.4/src/assemble/platform/debian/init.d/accumulo-gc
URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/src/assemble/platform/debian/init.d/accumulo-gc?rev=1384111&r1=1384110&r2=1384111&view=diff
==============================================================================
--- accumulo/branches/1.4/src/assemble/platform/debian/init.d/accumulo-gc (original)
+++ accumulo/branches/1.4/src/assemble/platform/debian/init.d/accumulo-gc Wed Sep 12 20:32:01
2012
@@ -19,7 +19,8 @@ DESC="Accumulo Garbage Collector"
 NAME=accumulo-gc
 ACCUMULO_PROC=gc
 DAEMON=/usr/lib/accumulo/bin/start-server.sh
-DAEMON_ARGS="localhost gc \"garbage collector\""
+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`
+DAEMON_ARGS="$IP gc \"garbage collector\""
 PIDFILE=/var/run/$NAME.pid
 SCRIPTNAME=/etc/init.d/$NAME
 

Modified: accumulo/branches/1.4/src/assemble/platform/debian/init.d/accumulo-master
URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/src/assemble/platform/debian/init.d/accumulo-master?rev=1384111&r1=1384110&r2=1384111&view=diff
==============================================================================
--- accumulo/branches/1.4/src/assemble/platform/debian/init.d/accumulo-master (original)
+++ accumulo/branches/1.4/src/assemble/platform/debian/init.d/accumulo-master Wed Sep 12 20:32:01
2012
@@ -19,7 +19,8 @@ DESC="Accumulo Master"
 NAME=accumulo-master
 ACCUMULO_PROC=master
 DAEMON=/usr/lib/accumulo/bin/start-server.sh
-DAEMON_ARGS="localhost master"
+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`
+DAEMON_ARGS="$IP master"
 PIDFILE=/var/run/$NAME.pid
 SCRIPTNAME=/etc/init.d/$NAME
 

Modified: accumulo/branches/1.4/src/assemble/platform/debian/init.d/accumulo-monitor
URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/src/assemble/platform/debian/init.d/accumulo-monitor?rev=1384111&r1=1384110&r2=1384111&view=diff
==============================================================================
--- accumulo/branches/1.4/src/assemble/platform/debian/init.d/accumulo-monitor (original)
+++ accumulo/branches/1.4/src/assemble/platform/debian/init.d/accumulo-monitor Wed Sep 12
20:32:01 2012
@@ -19,7 +19,8 @@ DESC="Accumulo Monitor"
 NAME=accumulo-monitor
 ACCUMULO_PROC=monitor
 DAEMON=/usr/lib/accumulo/bin/start-server.sh
-DAEMON_ARGS="localhost monitor"
+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`
+DAEMON_ARGS="$IP monitor"
 PIDFILE=/var/run/$NAME.pid
 SCRIPTNAME=/etc/init.d/$NAME
 

Modified: accumulo/branches/1.4/src/assemble/platform/debian/init.d/accumulo-slave
URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/src/assemble/platform/debian/init.d/accumulo-slave?rev=1384111&r1=1384110&r2=1384111&view=diff
==============================================================================
--- accumulo/branches/1.4/src/assemble/platform/debian/init.d/accumulo-slave (original)
+++ accumulo/branches/1.4/src/assemble/platform/debian/init.d/accumulo-slave Wed Sep 12 20:32:01
2012
@@ -20,7 +20,8 @@ NAME=accumulo-slave
 ACCUMULO_PROC1=tserver
 ACCUMULO_PROC2=logger
 DAEMON=/usr/lib/accumulo/bin/start-server.sh
-DAEMON_ARGS="localhost master"
+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`
+DAEMON_ARGS="$IP slaves"
 PIDFILE=/var/run/$NAME.pid
 SCRIPTNAME=/etc/init.d/$NAME
 
@@ -46,9 +47,9 @@ do_start()
 	#  2 if daemon could not be started
 	
 	if [ "`jps -m | grep $ACCUMULO_PROC1`" -a "`jps -m | grep $ACCUMULO_PROC2`" ] ; then return
1; fi
-	
-	/usr/lib/accumulo/bin/start-server.sh localhost logger
-      	/usr/lib/accumulo/bin/start-server.sh localhost tserver "tablet server"
+
+  /usr/lib/accumulo/bin/start-server.sh $IP logger
+  /usr/lib/accumulo/bin/start-server.sh $IP tserver "tablet server"
 
 	if [ "`jps -m | grep $ACCUMULO_PROC1`" -a "`jps -m | grep $ACCUMULO_PROC2`" ] ; then return
0; fi
 	return 2
@@ -70,7 +71,7 @@ do_stop()
 
 	if [ ! "`jps -m | grep $ACCUMULO_PROC1`" -a ! "`jps -m | grep $ACCUMULO_PROC2`" ] ; then
return 1; fi
 
-	/usr/lib/accumulo/bin/accumulo admin stop localhost
+	/usr/lib/accumulo/bin/accumulo admin stop $IP 
 
 	if [ "`jps -m | grep $ACCUMULO_PROC1`" ] ; then jps -m | grep $ACCUMULO_PROC1 | awk '{print
$1}' | xargs kill -9; fi
 	if [ "`jps -m | grep $ACCUMULO_PROC2`" ] ; then jps -m | grep $ACCUMULO_PROC2 | awk '{print
$1}' | xargs kill -9; fi

Modified: accumulo/branches/1.4/src/assemble/platform/debian/init.d/accumulo-tracer
URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/src/assemble/platform/debian/init.d/accumulo-tracer?rev=1384111&r1=1384110&r2=1384111&view=diff
==============================================================================
--- accumulo/branches/1.4/src/assemble/platform/debian/init.d/accumulo-tracer (original)
+++ accumulo/branches/1.4/src/assemble/platform/debian/init.d/accumulo-tracer Wed Sep 12 20:32:01
2012
@@ -19,7 +19,8 @@ DESC="Accumulo Tracer"
 NAME=accumulo-tracer
 ACCUMULO_PROC=tracer
 DAEMON=/usr/lib/accumulo/bin/start-server.sh
-DAEMON_ARGS="localhost tracer"
+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`
+DAEMON_ARGS="$IP tracer"
 PIDFILE=/var/run/$NAME.pid
 SCRIPTNAME=/etc/init.d/$NAME
 



Mime
View raw message