You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ct...@apache.org on 2015/05/22 02:54:41 UTC

[11/14] accumulo git commit: Merge branch '1.5' into 1.6

Merge branch '1.5' into 1.6

Conflicts:
	assemble/bin/accumulo


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/53b98614
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/53b98614
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/53b98614

Branch: refs/heads/master
Commit: 53b98614c2ea91a75f87698fbfb77e67484f1893
Parents: 63be7d3 5db68da
Author: Christopher Tubbs <ct...@apache.org>
Authored: Thu May 21 20:48:12 2015 -0400
Committer: Christopher Tubbs <ct...@apache.org>
Committed: Thu May 21 20:48:12 2015 -0400

----------------------------------------------------------------------
 assemble/bin/accumulo     | 5 -----
 assemble/bin/stop-here.sh | 2 +-
 2 files changed, 1 insertion(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/53b98614/assemble/bin/accumulo
----------------------------------------------------------------------
diff --cc assemble/bin/accumulo
index bdd742d,0000000..0c6c137
mode 100755,000000..100755
--- a/assemble/bin/accumulo
+++ b/assemble/bin/accumulo
@@@ -1,171 -1,0 +1,166 @@@
 +#! /usr/bin/env bash
 +
 +# Licensed to the Apache Software Foundation (ASF) under one or more
 +# contributor license agreements.  See the NOTICE file distributed with
 +# this work for additional information regarding copyright ownership.
 +# The ASF licenses this file to You under the Apache License, Version 2.0
 +# (the "License"); you may not use this file except in compliance with
 +# the License.  You may obtain a copy of the License at
 +#
 +#     http://www.apache.org/licenses/LICENSE-2.0
 +#
 +# Unless required by applicable law or agreed to in writing, software
 +# distributed under the License is distributed on an "AS IS" BASIS,
 +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 +# See the License for the specific language governing permissions and
 +# limitations under the License.
 +
 +# Start: Resolve Script Directory
 +SOURCE="${BASH_SOURCE[0]}"
 +while [ -h "${SOURCE}" ]; do # resolve $SOURCE until the file is no longer a symlink
 +   bin="$( cd -P "$( dirname "${SOURCE}" )" && pwd )"
 +   SOURCE="$(readlink "${SOURCE}")"
 +   [[ "${SOURCE}" != /* ]] && SOURCE="${bin}/${SOURCE}" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
 +done
 +bin="$( cd -P "$( dirname "${SOURCE}" )" && pwd )"
 +script=$( basename "${SOURCE}" )
 +# Stop: Resolve Script Directory
 +
 +. "${bin}"/config.sh
 +
 +START_JAR="${ACCUMULO_HOME}/lib/accumulo-start.jar"
 +if [ ! -f "$START_JAR" ]; then
 +   if [ -x /bin/rpm ]; then
 +       START_JAR=$(echo $(/bin/rpm -E "%{_javadir}/accumulo/"accumulo-start-*.jar))
 +   fi
 +fi
 +
 +#
 +# Resolve a program to its installation directory
 +#
 +locationByProgram()
 +{
 +   RESULT=$( which "$1" )
 +   if [[ "$?" != 0 && -z "${RESULT}" ]]; then
 +      echo "Cannot find '$1' and '$2' is not set in $ACCUMULO_CONF_DIR/accumulo-env.sh"
 +      exit 1
 +   fi
 +   while [ -h "${RESULT}" ]; do # resolve $RESULT until the file is no longer a symlink
 +      DIR="$( cd -P "$( dirname "$RESULT" )" && pwd )"
 +      RESULT="$(readlink "${RESULT}")"
 +      [[ "${RESULT}" != /* ]] && RESULT="${DIR}/${RESULT}" # if $RESULT was a relative symlink, we need to resolve it relative to the path where the symlink file was located
 +   done
 +   # find the relative home directory, accounting for an extra bin directory
 +   RESULT=$(dirname $(dirname "${RESULT}") )
 +   echo "Auto-set ${2} to '${RESULT}'.  To suppress this message, set ${2} in conf/accumulo-env.sh"
 +   eval "${2}=${RESULT}"
 +}
 +
 +test -z "${JAVA_HOME}"      && locationByProgram java JAVA_HOME
 +test -z "${HADOOP_PREFIX}"  && locationByProgram hadoop HADOOP_PREFIX
 +test -z "${ZOOKEEPER_HOME}" && locationByProgram zkCli.sh ZOOKEEPER_HOME
 +
 +DEFAULT_GENERAL_JAVA_OPTS=""
 +
 +#
 +# ACCUMULO_XTRAJARS is where all of the commandline -add items go into for reading by accumulo.
 +# It also holds the JAR run with the jar command and, if possible, any items in the JAR manifest's Class-Path.
 +#
 +if [ "$1" = "-add" ] ; then
 +    export ACCUMULO_XTRAJARS="$2"
 +    shift 2
 +else
 +    export ACCUMULO_XTRAJARS=""
 +fi
 +if [ "$1" = "jar" -a -f "$2" ] ; then
 +    if [[ $2 =~ ^/ ]]; then
 +      jardir="$(dirname "$2")"
 +      jarfile="$2"
 +    else
 +      jardir="$(pwd)"
 +      jarfile="${jardir}/${2}"
 +    fi
 +    if jar tf "$jarfile" | grep -q META-INF/MANIFEST.MF ; then
 +      cp="$(unzip -p "$jarfile" META-INF/MANIFEST.MF | grep ^Class-Path: | sed 's/^Class-Path: *//')"
 +      if [ -n "$cp" ] ; then
 +         for j in $cp; do
 +            if [ "$j" != "Class-Path:" ]; then
 +               ACCUMULO_XTRAJARS="${jardir}/${j},$ACCUMULO_XTRAJARS"
 +            fi
 +         done
 +      fi
 +    fi
 +    ACCUMULO_XTRAJARS="${jarfile},$ACCUMULO_XTRAJARS"
 +fi
 +
 +#
 +# Set up -D switches for JAAS and Kerberos if env variables set
 +#
 +if [ ! -z ${ACCUMULO_JAAS_CONF} ]; then
 +  ACCUMULO_GENERAL_OPTS="${ACCUMULO_GENERAL_OPTS} -Djava.security.auth.login.config=${ACCUMULO_JAAS_CONF}"
 +fi
 +
 +if [ ! -z ${ACCUMULO_KRB5_CONF} ]; then
 +  ACCUMULO_GENERAL_OPTS="${ACCUMULO_GENERAL_OPTS} -Djava.security.krb5.conf=${ACCUMULO_KRB5_CONF}"
 +fi
 +
 +#
 +# Add appropriate options for process type
 +#
 +case "$1" in
 +master)  export ACCUMULO_OPTS="${ACCUMULO_GENERAL_OPTS} ${ACCUMULO_MASTER_OPTS}" ;;
 +gc)      export ACCUMULO_OPTS="${ACCUMULO_GENERAL_OPTS} ${ACCUMULO_GC_OPTS}" ;;
 +tserver) export ACCUMULO_OPTS="${ACCUMULO_GENERAL_OPTS} ${ACCUMULO_TSERVER_OPTS}" ;;
 +monitor) export ACCUMULO_OPTS="${ACCUMULO_GENERAL_OPTS} ${ACCUMULO_MONITOR_OPTS}" ;;
- logger)  export ACCUMULO_OPTS="${ACCUMULO_GENERAL_OPTS} ${ACCUMULO_LOGGER_OPTS}" ;;
 +*)       export ACCUMULO_OPTS="${ACCUMULO_GENERAL_OPTS} ${ACCUMULO_OTHER_OPTS}" ;;
 +esac
 +
 +XML_FILES="${ACCUMULO_CONF_DIR}"
 +LOG4J_JAR=$(find -H "${HADOOP_PREFIX}/lib" "${HADOOP_PREFIX}"/share/hadoop/common/lib -name 'log4j*.jar' -print 2>/dev/null | head -1)
 +CLASSPATH="${XML_FILES}:${START_JAR}:${LOG4J_JAR}"
 +
 +if [ -z "${JAVA_HOME}" -o ! -d "${JAVA_HOME}" ]; then
 +   echo "JAVA_HOME is not set or is not a directory.  Please make sure it's set globally or in conf/accumulo-env.sh"
 +   exit 1
 +fi
 +if [ -z "${HADOOP_PREFIX}" -o ! -d "${HADOOP_PREFIX}" ]; then
 +   echo "HADOOP_PREFIX is not set or is not a directory.  Please make sure it's set globally or in conf/accumulo-env.sh"
 +   exit 1
 +fi
 +if [ -z "${ZOOKEEPER_HOME}" -o ! -d "${ZOOKEEPER_HOME}" ]; then
 +   echo "ZOOKEEPER_HOME is not set or is not a directory.  Please make sure it's set globally or in conf/accumulo-env.sh"
 +   exit 1
 +fi
 +if [ -z "${ACCUMULO_LOG_DIR}" ]; then
 +   echo "ACCUMULO_LOG_DIR is not set.  Please make sure it's set globally or in conf/accumulo-env.sh"
 +   exit 1
 +fi
 +
- if [ ! -d "${ACCUMULO_LOG_DIR}" ]; then
-    mkdir -p "$ACCUMULO_LOG_DIR"
- fi
- 
 +# This is default for hadoop 2.x;
 +#   for hadoop 1.0, 1.1, specify (DY)LD_LIBRARY_PATH
 +#   explicitly in ${ACCUMULO_HOME}/conf/accumulo-env.sh
 +#   usually something like:
 +#     ${HADOOP_PREFIX}/lib/native/${PLATFORM}
 +if [ -e "${HADOOP_PREFIX}/lib/native/libhadoop.so" ]; then
 +   LIB_PATH="${HADOOP_PREFIX}/lib/native"
 +   LD_LIBRARY_PATH="${LIB_PATH}:${LD_LIBRARY_PATH}"     # For Linux
 +   DYLD_LIBRARY_PATH="${LIB_PATH}:${DYLD_LIBRARY_PATH}" # For Mac
 +fi
 +
 +# Export the variables just in case they are not exported
 +# This makes them available to java
 +export JAVA_HOME HADOOP_PREFIX ZOOKEEPER_HOME LD_LIBRARY_PATH DYLD_LIBRARY_PATH
 +#
 +# app isn't used anywhere, but it makes the process easier to spot when ps/top/snmp truncate the command line
 +JAVA="${JAVA_HOME}/bin/java"
 +exec $JAVA "-Dapp=$1" \
 +   $ACCUMULO_OPTS \
 +   -classpath "${CLASSPATH}" \
 +   -XX:OnOutOfMemoryError="${ACCUMULO_KILL_CMD:-kill -9 %p}" \
 +   -XX:-OmitStackTraceInFastThrow \
 +   -Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl \
 +   -Dorg.apache.accumulo.core.home.dir="${ACCUMULO_HOME}" \
 +   -Dhadoop.home.dir="${HADOOP_PREFIX}" \
 +   -Dzookeeper.home.dir="${ZOOKEEPER_HOME}" \
 +   org.apache.accumulo.start.Main \
 +   "$@"

http://git-wip-us.apache.org/repos/asf/accumulo/blob/53b98614/assemble/bin/stop-here.sh
----------------------------------------------------------------------
diff --cc assemble/bin/stop-here.sh
index 4d5533a,0000000..49defa9
mode 100755,000000..100755
--- a/assemble/bin/stop-here.sh
+++ b/assemble/bin/stop-here.sh
@@@ -1,60 -1,0 +1,60 @@@
 +#! /usr/bin/env bash
 +
 +# Licensed to the Apache Software Foundation (ASF) under one or more
 +# contributor license agreements.  See the NOTICE file distributed with
 +# this work for additional information regarding copyright ownership.
 +# The ASF licenses this file to You under the Apache License, Version 2.0
 +# (the "License"); you may not use this file except in compliance with
 +# the License.  You may obtain a copy of the License at
 +#
 +#     http://www.apache.org/licenses/LICENSE-2.0
 +#
 +# Unless required by applicable law or agreed to in writing, software
 +# distributed under the License is distributed on an "AS IS" BASIS,
 +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 +# See the License for the specific language governing permissions and
 +# limitations under the License.
 +
 +#
 +# This script safely stops all the accumulo services on this host
 +#
 +
 +# Start: Resolve Script Directory
 +SOURCE="${BASH_SOURCE[0]}"
 +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
 +   bin="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
 +   SOURCE="$(readlink "$SOURCE")"
 +   [[ $SOURCE != /* ]] && SOURCE="$bin/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
 +done
 +bin="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
 +# Stop: Resolve Script Directory
 +
 +. "$bin"/config.sh
 +
 +ACCUMULO="$ACCUMULO_HOME/lib/accumulo-start.jar"
 +
 +# Determine hostname without errors to user
 +HOSTNAME=$(hostname -a 2> /dev/null | head -1)
 +if [ -z ${HOSTNAME} ]; then
 +   HOSTNAME=$(hostname)
 +fi
 +
 +if egrep -q localhost\|127.0.0.1 $ACCUMULO_CONF_DIR/slaves; then
 +   $bin/accumulo admin stop localhost
 +else
 +   for host in "$(hostname -a 2> /dev/null) $(hostname)"; do
 +      if grep -q ${host} $ACCUMULO_CONF_DIR/slaves; then
 +         ${bin}/accumulo admin stop $host
 +      fi
 +   done
 +fi
 +
 +for signal in TERM KILL; do
-    for svc in tserver gc master monitor logger tracer; do
++   for svc in tserver gc master monitor tracer; do
 +      PID=$(ps -ef | egrep ${ACCUMULO} | grep "Main $svc" | grep -v grep | grep -v stop-here.sh | awk '{print $2}' | head -1)
 +      if [ ! -z $PID ]; then
 +         echo "Stopping ${svc} on ${HOSTNAME} with signal ${signal}"
 +         kill -s ${signal} ${PID}
 +      fi
 +   done
 +done