Skip to content

Commit

Permalink
Merge branch '1.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
joshelser committed Aug 15, 2016
2 parents 45d73b1 + 30d065d commit 97209ba
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 12 deletions.
15 changes: 11 additions & 4 deletions assemble/bin/accumulo
Expand Up @@ -154,20 +154,27 @@ export JAVA_HOME HADOOP_PREFIX ZOOKEEPER_HOME LD_LIBRARY_PATH DYLD_LIBRARY_PATH

# Strip the instance from $1
APP=$1
INSTANCE="1"
# Avoid setting an instance unless it's necessary to ensure consistency in filenames
INSTANCE=""
# Avoid setting a pointless system property
INSTANCE_OPT=""
if [[ "$1" =~ .*-.* ]]; then
APP=`echo $1 | cut -d"-" -f1`
INSTANCE=`echo $1 | cut -d"-" -f2`
APP="$(echo $1 | cut -d'-' -f1)"
# Appending the trailing underscore to make single-tserver deploys look how they did
INSTANCE="$(echo $1 | cut -d'-' -f2)_"

#Rewrite the input arguments
set -- "$APP" "${@:2}"

# The extra system property we'll pass to the java cmd
INSTANCE_OPT="-Daccumulo.service.instance=${INSTANCE}"
fi

#
# 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" \
"-Dinstance=$INSTANCE" \
$INSTANCE_OPT \
$ACCUMULO_OPTS \
-classpath "${CLASSPATH}" \
-XX:OnOutOfMemoryError="${ACCUMULO_KILL_CMD:-kill -9 %p}" \
Expand Down
10 changes: 7 additions & 3 deletions assemble/bin/config.sh
Expand Up @@ -118,11 +118,15 @@ else
export NUMA_CMD=""
fi

# NUMA sanity checks
if [[ -z $NUM_TSERVERS ]]; then
echo "NUM_TSERVERS is missing in accumulo-env.sh, please check your configuration."
NUM_TSERVERS=${NUM_TSERVERS:-1}

# Validate that NUM_TSERVERS is a positive integer
if ! [[ $NUM_TSERVERS =~ ^[0-9]+$ ]]; then
echo "NUM_TSERVERS, when defined in accumulo-env.sh, should be a positive number, is '$NUM_TSERVERS'"
exit 1
fi

# NUMA sanity checks
if [[ $NUM_TSERVERS -eq 1 && -n $TSERVER_NUMA_OPTIONS ]]; then
echo "TSERVER_NUMA_OPTIONS declared when NUM_TSERVERS is 1, use ACCUMULO_NUMACTL_OPTIONS instead"
exit 1
Expand Down
11 changes: 10 additions & 1 deletion assemble/bin/start-daemon.sh
Expand Up @@ -138,8 +138,17 @@ else
fi
fi

# We want the files to be consistently named with the log files
# server_identifier_hostname.{out,err}, e.g. tserver_2_fqdn.out
OUTFILE="${ACCUMULO_LOG_DIR}/${S}_${t}_${LOGHOST}.out"
ERRFILE="${ACCUMULO_LOG_DIR}/${S}_${t}_${LOGHOST}.err"

# Rotate the .out and .err files
rotate_log "$OUTFILE" ${ACCUMULO_NUM_OUT_FILES}
rotate_log "$ERRFILE" ${ACCUMULO_NUM_OUT_FILES}

# Fork the process, store the pid
nohup ${NUMA_CMD} "$COMMAND" "${SERVICE}" --address "${ADDRESS}" >"${ACCUMULO_LOG_DIR}/${SERVICE}_${LOGHOST}.out" 2>"${ACCUMULO_LOG_DIR}/${SERVICE}_${LOGHOST}.err" < /dev/null &
nohup ${NUMA_CMD} "$COMMAND" "${SERVICE}" --address "${ADDRESS}" >"$OUTFILE" 2>"$ERRFILE" < /dev/null &
echo $! > ${PID_FILE}

done
Expand Down
4 changes: 2 additions & 2 deletions assemble/conf/templates/generic_logger.properties
Expand Up @@ -15,7 +15,7 @@

# Write out everything at the DEBUG level to the debug log
log4j.appender.A2=org.apache.log4j.RollingFileAppender
log4j.appender.A2.File=${org.apache.accumulo.core.dir.log}/${org.apache.accumulo.core.application}_${org.apache.accumulo.core.ip.localhost.hostname}_fromprops.debug.log
log4j.appender.A2.File=${org.apache.accumulo.core.dir.log}/${org.apache.accumulo.core.application}_${accumulo.service.instance}${org.apache.accumulo.core.ip.localhost.hostname}_fromprops.debug.log
log4j.appender.A2.MaxFileSize=1000MB
log4j.appender.A2.MaxBackupIndex=10
log4j.appender.A2.Threshold=DEBUG
Expand All @@ -24,7 +24,7 @@ log4j.appender.A2.layout.ConversionPattern=%d{ISO8601} [%-8c{2}] %-5p: %m%n

# Write out INFO and higher to the regular log
log4j.appender.A3=org.apache.log4j.RollingFileAppender
log4j.appender.A3.File=${org.apache.accumulo.core.dir.log}/${org.apache.accumulo.core.application}_${org.apache.accumulo.core.ip.localhost.hostname}_fromprops.log
log4j.appender.A3.File=${org.apache.accumulo.core.dir.log}/${org.apache.accumulo.core.application}_${accumulo.service.instance}${org.apache.accumulo.core.ip.localhost.hostname}_fromprops.log
log4j.appender.A3.MaxFileSize=1000MB
log4j.appender.A3.MaxBackupIndex=10
log4j.appender.A3.Threshold=INFO
Expand Down
4 changes: 2 additions & 2 deletions assemble/conf/templates/generic_logger.xml
Expand Up @@ -20,7 +20,7 @@

<!-- Write out everything at the DEBUG level to the debug log -->
<appender name="A2" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="${org.apache.accumulo.core.dir.log}/${org.apache.accumulo.core.application}_${instance}_${org.apache.accumulo.core.ip.localhost.hostname}.debug.log"/>
<param name="File" value="${org.apache.accumulo.core.dir.log}/${org.apache.accumulo.core.application}_${accumulo.service.instance}${org.apache.accumulo.core.ip.localhost.hostname}.debug.log"/>
<param name="MaxFileSize" value="1000MB"/>
<param name="MaxBackupIndex" value="10"/>
<param name="Threshold" value="DEBUG"/>
Expand All @@ -31,7 +31,7 @@

<!-- Write out INFO and higher to the regular log -->
<appender name="A3" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="${org.apache.accumulo.core.dir.log}/${org.apache.accumulo.core.application}_${instance}_${org.apache.accumulo.core.ip.localhost.hostname}.log"/>
<param name="File" value="${org.apache.accumulo.core.dir.log}/${org.apache.accumulo.core.application}_${accumulo.service.instance}${org.apache.accumulo.core.ip.localhost.hostname}.log"/>
<param name="MaxFileSize" value="1000MB"/>
<param name="MaxBackupIndex" value="10"/>
<param name="Threshold" value="INFO"/>
Expand Down

0 comments on commit 97209ba

Please sign in to comment.