You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by el...@apache.org on 2013/12/19 03:54:06 UTC

[1/3] git commit: ACCUMULO-2004 Check for libhadoop.so, not the a directory we think it might be in.

Updated Branches:
  refs/heads/1.6.0-SNAPSHOT 5d952c748 -> 152f1942e


ACCUMULO-2004 Check for libhadoop.so, not the a directory we think it might be in.


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

Branch: refs/heads/1.6.0-SNAPSHOT
Commit: 53a7d518cacf2d64ccd2ab04fa84242adf8084b1
Parents: 40df8cd
Author: Josh Elser <el...@apache.org>
Authored: Wed Dec 18 21:30:27 2013 -0500
Committer: Josh Elser <el...@apache.org>
Committed: Wed Dec 18 21:30:27 2013 -0500

----------------------------------------------------------------------
 bin/accumulo | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/53a7d518/bin/accumulo
----------------------------------------------------------------------
diff --git a/bin/accumulo b/bin/accumulo
index e2a89e9..172951e 100755
--- a/bin/accumulo
+++ b/bin/accumulo
@@ -131,12 +131,16 @@ CLASSPATH=${XML_FILES}:${START_JAR}:${COMMONS_JCI_JARS}
 
 JAVA=$JAVA_HOME/bin/java
 PLATFORM="`$JAVA -cp $CLASSPATH org.apache.accumulo.start.Platform`"
-# hadoop 1.0, 1.1
+
+# Try to find the hadoop native library, defaulting to where it should
+# be for the default Hadoop version
 LIB_PATH="$HADOOP_PREFIX/lib/native/$PLATFORM"
-if [ ! -d "$LIB_PATH" ]; then
-   # hadoop-2.0
-   LIB_PATH=$HADOOP_PREFIX/lib/native
+
+if [ -e "$HADOOP_PREFIX/lib/native/libhadoop.so" ]; then
+    # hadoop-2.0
+    LIB_PATH=$HADOOP_PREFIX/lib/native
 fi
+
 #
 # app isn't used anywhere, but it makes the process easier to spot when ps/top/snmp truncate the command line
 exec $JAVA "-Dapp=$1" $ACCUMULO_OPTS -classpath $CLASSPATH -XX:OnOutOfMemoryError="${ACCUMULO_KILL_CMD:-kill -9 %p}" \


[3/3] git commit: Merge branch '1.5.1-SNAPSHOT' into 1.6.0-SNAPSHOT

Posted by el...@apache.org.
Merge branch '1.5.1-SNAPSHOT' into 1.6.0-SNAPSHOT

Conflicts:
	bin/accumulo


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

Branch: refs/heads/1.6.0-SNAPSHOT
Commit: 152f1942ee894d75836d6d9321585913bc176e79
Parents: 5d952c7 a55f5d3
Author: Josh Elser <el...@apache.org>
Authored: Wed Dec 18 21:53:25 2013 -0500
Committer: Josh Elser <el...@apache.org>
Committed: Wed Dec 18 21:53:25 2013 -0500

----------------------------------------------------------------------
 bin/accumulo | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/152f1942/bin/accumulo
----------------------------------------------------------------------
diff --cc bin/accumulo
index 14918c8,2ad8720..89f5624
--- a/bin/accumulo
+++ b/bin/accumulo
@@@ -125,29 -104,26 +125,29 @@@ if [ ! -d "${ACCUMULO_LOG_DIR}" ]; the
     mkdir -p "$ACCUMULO_LOG_DIR"
  fi
  
 -# Export the variables just in case they are not exported
 -# This makes them available to java
 -export JAVA_HOME HADOOP_PREFIX ZOOKEEPER_HOME
 -
 -JAVA="${JAVA_HOME}/bin/java"
 -PLATFORM=$( "${JAVA}" -cp "${CLASSPATH}" org.apache.accumulo.start.Platform )
 -
 -# Try to find the hadoop native library, defaulting to where it should
 -# be for the default Hadoop version
 -LIB_PATH="${HADOOP_PREFIX}/lib/native/${PLATFORM}"
 +# 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 [ -d "${HADOOP_PREFIX}/lib/native" ]; then
+ if [ -e "${HADOOP_PREFIX}/lib/native/libhadoop.so" ]; then
 -   # hadoop-2.0
     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
 -exec $JAVA "-Dapp=$1" $ACCUMULO_OPTS -classpath "${CLASSPATH}" -XX:OnOutOfMemoryError="${ACCUMULO_KILL_CMD:-kill -9 %p}" \
 +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 \
 -   -Djava.library.path="${LIB_PATH}" \
     -Dorg.apache.accumulo.core.home.dir="${ACCUMULO_HOME}" \
     -Dhadoop.home.dir="${HADOOP_PREFIX}" \
     -Dzookeeper.home.dir="${ZOOKEEPER_HOME}" \


[2/3] git commit: Merge branch '1.4.5-SNAPSHOT' into 1.5.1-SNAPSHOT

Posted by el...@apache.org.
Merge branch '1.4.5-SNAPSHOT' into 1.5.1-SNAPSHOT

Conflicts:
	bin/accumulo


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

Branch: refs/heads/1.6.0-SNAPSHOT
Commit: a55f5d3f02af0eed1337762925c8b88bc022239a
Parents: 4bed940 53a7d51
Author: Josh Elser <el...@apache.org>
Authored: Wed Dec 18 21:41:56 2013 -0500
Committer: Josh Elser <el...@apache.org>
Committed: Wed Dec 18 21:41:56 2013 -0500

----------------------------------------------------------------------
 bin/accumulo | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/a55f5d3f/bin/accumulo
----------------------------------------------------------------------
diff --cc bin/accumulo
index 1d1040e,172951e..2ad8720
--- a/bin/accumulo
+++ b/bin/accumulo
@@@ -15,114 -15,139 +15,117 @@@
  # See the License for the specific language governing permissions and
  # limitations under the License.
  
 -# The main Accumulo command script.  
 -#
 -# Environment variables parameters: 
 -#
 -#  JAVA_HOME           The java implenetation to use. 
 -#  ACCUMULO_CONF_DIR   Location where accumulo-env.sh, accumulo-site.xml and friends will be read from
 -#  ACCUMULO_LOG_DIR    Directory for accmulo daemon logs.  defaults to $ACCUMULO_HOME/logs
 -#  ACCUMULO_VERSION    This Accumulo's version number 
 -#  HADOOP_HOME         The home diretcory for HADOOP.  Defaults to bin/hadoop's parent.
 -# 
 -# Java jvm paramters:  (-Xmx et al)
 -# 
 -#  ACCUMULO_TSERVER_OPTS
 -#  ACCUMULO_MASTER_OPTS
 -#  ACCUMULO_GC_OPTS
 -#  ACCUMULO_MONITOR_OPTS
 -#  ACCUMULO_LOGGER_OPTS
 -#  ACCUMULO_GENERAL_OPTS
 -#  ACCUMULO_OTHER_OPTS
 -# 
 -# Environment variables overriden by config.sh
 -#
 -#  ACCUMULO_HOME     Always the parent dir of bin/accumulo
 -
 -bin=`dirname "$0"`
 -bin=`cd "$bin"; pwd`
 +# 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
 +. "${bin}"/config.sh
  
 -if [ -z "$JAVA_HOME" -o ! -d "$JAVA_HOME" ]; then
 -    echo "JAVA_HOME is not set.  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.  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.  Please make sure it's set globally or in conf/accumulo-env.sh"
 -    exit 1
 -fi
 -
 -#Export the variables just in case they are not exported
 -#This makes them available to java
 -export JAVA_HOME=$JAVA_HOME
 -export HADOOP_PREFIX=$HADOOP_PREFIX
 -export ZOOKEEPER_HOME=$ZOOKEEPER_HOME
 -# backwards compatible with old configurations
 -export HADOOP_HOME=$HADOOP_PREFIX
 -export HADOOP_HOME_WARN_SUPPRESS=1
 -
 -START_JAR=$ACCUMULO_HOME/lib/accumulo-start-$ACCUMULO_VERSION.jar
 -COMMONS_JCI_JARS=$ACCUMULO_HOME/lib/commons-jci-core-1.0.jar:$ACCUMULO_HOME/lib/commons-jci-fam-1.0.jar:$ACCUMULO_HOME/lib/log4j-1.2.16.jar:$ACCUMULO_HOME/lib/commons-logging-1.0.4.jar:$ACCUMULO_HOME/lib/commons-logging-api-1.0.4.jar
 -START_CLASSES_DIR=$ACCUMULO_HOME/src/start/target/classes
 +START_JAR="${ACCUMULO_HOME}/lib/accumulo-start.jar"
  
 +#
 +# Resolve a program to its installation directory
 +#
  locationByProgram() 
  {
 -   # find the program
 -   RESULT=`which $1`
 -   # strip the program name from the path
 -   RESULT=`dirname ${RESULT}`
 -   # strip /bin from the path
 -   RESULT=`dirname ${RESULT}`
 -   echo ${RESULT}
 +   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
 +   RESULT=$(dirname "${RESULT}")
 +   echo "Auto-set ${2} to '${RESULT}'.  To suppress this message, set ${2} in conf/accumulo-env.sh"
 +   eval "${2}=${RESULT}"
  }
  
 -test -n "$JAVA_HOME"      || export JAVA_HOME=`locationByProgram java`
 -test -n "$HADOOP_PREFIX"  || export HADOOP_PREFIX=`locationByProgram hadoop`
 -test -n "$ZOOKEEPER_HOME" || export ZOOKEEPER_HOME=`locationByProgram zkCli.sh`
 -
 +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=""
 -BIG=6g
 -MED=3g
 -SMALL=512m
 -if ! "$JAVA_HOME/bin/java" -Xms10g -Xmx10g >/dev/null 2>&1 ; then
 -   BIG=3g
 -   MED=1g
 -   SMALL=256m
 -fi
 -
 -test -n "$ACCUMULO_TSERVER_OPTS" || export ACCUMULO_TSERVER_OPTS="-Xmx$BIG -Xms$BIG "
 -test -n "$ACCUMULO_MASTER_OPTS"  || export ACCUMULO_MASTER_OPTS="-Xmx$MED -Xms$MED "
 -test -n "$ACCUMULO_GC_OPTS"      || export ACCUMULO_GC_OPTS="-Xmx$SMALL -Xms$SMALL "
 -test -n "$ACCUMULO_MONITOR_OPTS" || export ACCUMULO_MONITOR_OPTS="-Xmx$MED -Xms$SMALL "
 -test -n "$ACCUMULO_LOGGER_OPTS"  || export ACCUMULO_LOGGER_OPTS="-Xmx$MED -Xms$SMALL "
 -test -n "$ACCUMULO_GENERAL_OPTS" || export ACCUMULO_GENERAL_OPTS="$DEFAULT_GENERAL_JAVA_OPTS"
 -test -n "$ACCUMULO_OTHER_OPTS"   || export ACCUMULO_OTHER_OPTS="-Xmx$MED -Xms$SMALL "
  
 +#
  # ACCUMULO_XTRAJARS is where all of the commandline -add items go into for reading by accumulo.
 +#
  if [ "$1" = "-add" ] ; then
 -	export ACCUMULO_XTRAJARS=$2
 -	shift 2
 +    export ACCUMULO_XTRAJARS="$2"
 +    shift 2
  else
 -	export ACCUMULO_XTRAJARS=""
 +    export ACCUMULO_XTRAJARS=""
  fi
  
 -if [ "$1" = "master" ] ; then
 -	export ACCUMULO_OPTS="${ACCUMULO_GENERAL_OPTS} ${ACCUMULO_MASTER_OPTS}"
 -elif [ "$1" = "gc" ] ; then
 -	export ACCUMULO_OPTS="${ACCUMULO_GENERAL_OPTS} ${ACCUMULO_GC_OPTS}"
 -elif [ "$1" = "tserver" ] ; then
 -	export ACCUMULO_OPTS="${ACCUMULO_GENERAL_OPTS} ${ACCUMULO_TSERVER_OPTS}"
 -elif [ "$1" = "monitor" ] ; then
 -	export ACCUMULO_OPTS="${ACCUMULO_GENERAL_OPTS} ${ACCUMULO_MONITOR_OPTS}"
 -elif [ "$1" = "logger" ] ; then
 -	export ACCUMULO_OPTS="${ACCUMULO_GENERAL_OPTS} ${ACCUMULO_LOGGER_OPTS}"
 -else
 -	export ACCUMULO_OPTS="${ACCUMULO_GENERAL_OPTS} ${ACCUMULO_OTHER_OPTS}"
 +#
 +# 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
  
 -XML_FILES=${ACCUMULO_CONF_DIR}
 -CLASSPATH=${XML_FILES}:${START_JAR}:${COMMONS_JCI_JARS}
 +if [ ! -d "${ACCUMULO_LOG_DIR}" ]; then
 +   mkdir -p "$ACCUMULO_LOG_DIR"
 +fi
 +
 +# Export the variables just in case they are not exported
 +# This makes them available to java
 +export JAVA_HOME HADOOP_PREFIX ZOOKEEPER_HOME
  
 -JAVA=$JAVA_HOME/bin/java
 -PLATFORM="`$JAVA -cp $CLASSPATH org.apache.accumulo.start.Platform`"
 +JAVA="${JAVA_HOME}/bin/java"
 +PLATFORM=$( "${JAVA}" -cp "${CLASSPATH}" org.apache.accumulo.start.Platform )
- # hadoop 1.0, 1.1
+ 
+ # Try to find the hadoop native library, defaulting to where it should
+ # be for the default Hadoop version
 -LIB_PATH="$HADOOP_PREFIX/lib/native/$PLATFORM"
 -
 -if [ -e "$HADOOP_PREFIX/lib/native/libhadoop.so" ]; then
 -    # hadoop-2.0
 -    LIB_PATH=$HADOOP_PREFIX/lib/native
 +LIB_PATH="${HADOOP_PREFIX}/lib/native/${PLATFORM}"
- if [ ! -d "${LIB_PATH}" ]; then
++if [ -e "${HADOOP_PREFIX}/lib/native/libhadoop.so" ]; then
 +   # hadoop-2.0
 +   LIB_PATH="${HADOOP_PREFIX}/lib/native"
  fi
+ 
  #
  # app isn't used anywhere, but it makes the process easier to spot when ps/top/snmp truncate the command line
 -exec $JAVA "-Dapp=$1" $ACCUMULO_OPTS -classpath $CLASSPATH -XX:OnOutOfMemoryError="${ACCUMULO_KILL_CMD:-kill -9 %p}" \
 +exec $JAVA "-Dapp=$1" $ACCUMULO_OPTS -classpath "${CLASSPATH}" -XX:OnOutOfMemoryError="${ACCUMULO_KILL_CMD:-kill -9 %p}" \
     -Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl \
 -   -Djava.library.path="$LIB_PATH" \
 -   -Dorg.apache.accumulo.core.home.dir="$ACCUMULO_HOME" \
 -   -Dhadoop.home.dir="$HADOOP_PREFIX" \
 -   -Dzookeeper.home.dir="$ZOOKEEPER_HOME" \
 +   -Djava.library.path="${LIB_PATH}" \
 +   -Dorg.apache.accumulo.core.home.dir="${ACCUMULO_HOME}" \
 +   -Dhadoop.home.dir="${HADOOP_PREFIX}" \
 +   -Dzookeeper.home.dir="${ZOOKEEPER_HOME}" \
     org.apache.accumulo.start.Main \
     "$@"