[
https://issues.apache.org/jira/browse/ACCUMULO-4162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15204691#comment-15204691
]
ASF GitHub Bot commented on ACCUMULO-4162:
------------------------------------------
Github user ctubbsii commented on a diff in the pull request:
https://github.com/apache/accumulo/pull/81#discussion_r56862234
--- Diff: assemble/bin/start-all.sh ---
@@ -28,50 +28,52 @@ bin="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
. "$bin"/config.sh
unset DISPLAY
-if [ ! -f $ACCUMULO_CONF_DIR/accumulo-env.sh ] ; then
+if [[ ! -f $ACCUMULO_CONF_DIR/accumulo-env.sh ]] ; then
echo "${ACCUMULO_CONF_DIR}/accumulo-env.sh does not exist. Please make
sure you configure Accumulo before you run anything"
echo "We provide examples you can copy in
${ACCUMULO_HOME}/conf/examples/ which are set up for your memory footprint"
exit 1
fi
-if [ -z "$ZOOKEEPER_HOME" ] ; then
+if [[ -z "$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
-if [ ! -d $ZOOKEEPER_HOME ]; then
+if [[ ! -d $ZOOKEEPER_HOME ]]; then
echo "ZOOKEEPER_HOME is not a directory: $ZOOKEEPER_HOME"
echo "Please check the setting, either globally or in accumulo-env.sh."
exit 1
fi
-ZOOKEEPER_VERSION=$(find -L $ZOOKEEPER_HOME -maxdepth 1 -name
"zookeeper-[0-9]*.jar" | head -1)
-if [ -z "$ZOOKEEPER_VERSION" ]; then
+ZOOKEEPER_VERSION=$(find -L "$ZOOKEEPER_HOME" -maxdepth 1 -name
"zookeeper-[0-9]*.jar" | head -1)
+if [[ -z "$ZOOKEEPER_VERSION" ]]; then
echo "A Zookeeper JAR was not found in $ZOOKEEPER_HOME."
echo "Please check ZOOKEEPER_HOME, either globally or in
accumulo-env.sh."
exit 1
fi
-ZOOKEEPER_VERSION=${ZOOKEEPER_VERSION##$ZOOKEEPER_HOME/zookeeper-}
-ZOOKEEPER_VERSION=${ZOOKEEPER_VERSION%%.jar}
+ZOOKEEPER_VERSION=$(basename "${ZOOKEEPER_VERSION##*-}" .jar)
-if [ "$ZOOKEEPER_VERSION" '<' "3.3.0" ]; then
+if [[ "$ZOOKEEPER_VERSION" < "3.3.0" ]]; then
echo "WARN : Using Zookeeper $ZOOKEEPER_VERSION. Use version 3.3.0 or
greater to avoid zookeeper deadlock bug.";
fi
-${bin}/start-server.sh $MONITOR monitor
+"${bin}/start-server.sh" "$MONITOR" monitor
-if [ "$1" != "--notSlaves" ]; then
- ${bin}/tup.sh
+if [[ "$1" != "--notSlaves" ]]; then
+ "${bin}/tup.sh"
fi
-${bin}/accumulo org.apache.accumulo.master.state.SetGoalState NORMAL
-for master in `egrep -v '(^#|^\s*$)' "$ACCUMULO_CONF_DIR/masters"`; do
- ${bin}/start-server.sh $master master
-done
+"${bin}/accumulo" org.apache.accumulo.master.state.SetGoalState NORMAL
-for gc in `egrep -v '(^#|^\s*$)' "$ACCUMULO_CONF_DIR/gc"`; do
- ${bin}/start-server.sh $gc gc "garbage collector"
-done
+startServersFromHostsFile() {
+ # use hostfile in conf dir to get hosts, and start each server with the
remaining args
+ local hostfile; hostfile="$1"
+ shift
+ local otherArgs; otherArgs=("$@")
+ while IFS=$' \t\n' read -r host; do
+ "${bin}/start-server.sh" "$host" "${otherArgs[@]}"
+ done < <(egrep -v '^(\s*#.*|\s*)$' "$ACCUMULO_CONF_DIR/$hostfile")
--- End diff --
I just thought this version was a bit more explicit. (It's also tolerant of
indented comment lines.)
Read as: lines either beginning by any amount of whitespace followed by a
comment OR any amount of whitespace before termination
Another variation, which might be more readable is: '^\s*(#.*)?$'
Read as: lines starting with any amount of whitespace, optionally followed
by a comment, before termination
> Invalid ZooKeeper version warning message
> -----------------------------------------
>
> Key: ACCUMULO-4162
> URL: https://issues.apache.org/jira/browse/ACCUMULO-4162
> Project: Accumulo
> Issue Type: Bug
> Components: scripts
> Affects Versions: 1.7.1
> Reporter: Josh Elser
> Assignee: Christopher Tubbs
> Fix For: 1.6.6, 1.7.2, 1.8.0
>
>
> Saw this when running Sven's docker image with ZooKeeper-3.4.8:
> {noformat}
> WARN : Using Zookeeper /zookeeper-3.4.8/zookeeper-3.4.8. Use version 3.4.0
> or greater. Older versions may not work reliably.
> {noformat}
> 3.4.8 > 3.4.0. Looks like the version detection is a bit busted.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)