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/09 03:45:55 UTC
git commit: ACCUMULO-1985 Allow the monitor to bind to all network
interfaces.
Updated Branches:
refs/heads/1.5.1-SNAPSHOT 9f9c0426e -> 7655de68f
ACCUMULO-1985 Allow the monitor to bind to all network interfaces.
Create a new configuration parameter that users can defined in accumulo-env.sh
that will, when starting the monitor process, override the value provided to the
--address option from the hostname to "0.0.0.0". We can't just put "0.0.0.0" in
conf/monitor as the scripts use each line in conf/monitor as the host to SSH to
and this would break starting the monitor on a remote host.
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/7655de68
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/7655de68
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/7655de68
Branch: refs/heads/1.5.1-SNAPSHOT
Commit: 7655de68fa94a379afe3ed4eb65c16c060b7e475
Parents: 9f9c042
Author: Josh Elser <el...@apache.org>
Authored: Sun Dec 8 21:39:41 2013 -0500
Committer: Josh Elser <el...@apache.org>
Committed: Sun Dec 8 21:39:41 2013 -0500
----------------------------------------------------------------------
bin/config.sh | 3 +++
bin/start-server.sh | 10 ++++++++--
conf/examples/1GB/native-standalone/accumulo-env.sh | 3 +++
conf/examples/1GB/standalone/accumulo-env.sh | 3 +++
conf/examples/2GB/native-standalone/accumulo-env.sh | 3 +++
conf/examples/2GB/standalone/accumulo-env.sh | 3 +++
conf/examples/3GB/native-standalone/accumulo-env.sh | 3 +++
conf/examples/3GB/standalone/accumulo-env.sh | 3 +++
conf/examples/512MB/native-standalone/accumulo-env.sh | 3 +++
conf/examples/512MB/standalone/accumulo-env.sh | 3 +++
10 files changed, 35 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7655de68/bin/config.sh
----------------------------------------------------------------------
diff --git a/bin/config.sh b/bin/config.sh
index dca2e99..16a566b 100755
--- a/bin/config.sh
+++ b/bin/config.sh
@@ -134,3 +134,6 @@ export HADOOP_HOME_WARN_SUPPRESS=true
# See HADOOP-7154 and ACCUMULO-847
export MALLOC_ARENA_MAX=${MALLOC_ARENA_MAX:-1}
+
+# ACCUMULO-1985 provide a way to use the scripts and still bind to all network interfaces
+export ACCUMULO_MONITOR_BIND_ALL=${ACCUMULO_MONITOR_BIND_ALL:-"false"}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7655de68/bin/start-server.sh
----------------------------------------------------------------------
diff --git a/bin/start-server.sh b/bin/start-server.sh
index e38c084..f5fd33a 100755
--- a/bin/start-server.sh
+++ b/bin/start-server.sh
@@ -34,6 +34,7 @@ if [ $? -ne 0 ]; then
else
LOGHOST=$(host "$1" | head -1 | cut -d' ' -f1)
fi
+ADDRESS="$1"
SERVICE="$2"
LONGNAME="$3"
if [ -z "$LONGNAME" ]; then
@@ -46,6 +47,11 @@ if [ ! -x $IFCONFIG ]; then
IFCONFIG='/bin/netstat -ie'
fi
+# ACCUMULO-1985 Allow monitor to bind on all interfaces
+if [ ${SERVICE} == "monitor" -a ${ACCUMULO_MONITOR_BIND_ALL} == "true" ]; then
+ ADDRESS="0.0.0.0"
+fi
+
ip=$($IFCONFIG 2>/dev/null| 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 [ $? != 0 ]
then
@@ -61,10 +67,10 @@ fi
if [ -z $PID ]; then
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 &
+ ${bin}/accumulo ${SERVICE} --address ${ADDRESS} >${ACCUMULO_LOG_DIR}/${SERVICE}_${LOGHOST}.out 2>${ACCUMULO_LOG_DIR}/${SERVICE}_${LOGHOST}.err &
MAX_FILES_OPEN=$(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' &"
+ $SSH $HOST "bash -c 'exec nohup ${bin}/accumulo ${SERVICE} --address ${ADDRESS} >${ACCUMULO_LOG_DIR}/${SERVICE}_${LOGHOST}.out 2>${ACCUMULO_LOG_DIR}/${SERVICE}_${LOGHOST}.err' &"
MAX_FILES_OPEN=$($SSH $HOST "/usr/bin/env bash -c 'ulimit -n'")
fi
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7655de68/conf/examples/1GB/native-standalone/accumulo-env.sh
----------------------------------------------------------------------
diff --git a/conf/examples/1GB/native-standalone/accumulo-env.sh b/conf/examples/1GB/native-standalone/accumulo-env.sh
index 3f7e63f..c683521 100755
--- a/conf/examples/1GB/native-standalone/accumulo-env.sh
+++ b/conf/examples/1GB/native-standalone/accumulo-env.sh
@@ -55,3 +55,6 @@ test -z "$ACCUMULO_OTHER_OPTS" && export ACCUMULO_OTHER_OPTS="-Xmx128m -Xms64m
export ACCUMULO_LOG_HOST=`(grep -v '^#' $ACCUMULO_HOME/conf/monitor ; echo localhost ) 2>/dev/null | head -1`
# what do when the JVM runs out of heap memory
export ACCUMULO_KILL_CMD='kill -9 %p'
+
+# Should the monitor bind to all network interfaces -- default: false
+# export ACCUMULO_MONITOR_BIND_ALL="true"
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7655de68/conf/examples/1GB/standalone/accumulo-env.sh
----------------------------------------------------------------------
diff --git a/conf/examples/1GB/standalone/accumulo-env.sh b/conf/examples/1GB/standalone/accumulo-env.sh
index d22caed..6fe9cf9 100755
--- a/conf/examples/1GB/standalone/accumulo-env.sh
+++ b/conf/examples/1GB/standalone/accumulo-env.sh
@@ -55,3 +55,6 @@ test -z "$ACCUMULO_OTHER_OPTS" && export ACCUMULO_OTHER_OPTS="-Xmx128m -Xms64m
export ACCUMULO_LOG_HOST=`(grep -v '^#' $ACCUMULO_HOME/conf/monitor ; echo localhost ) 2>/dev/null | head -1`
# what do when the JVM runs out of heap memory
export ACCUMULO_KILL_CMD='kill -9 %p'
+
+# Should the monitor bind to all network interfaces -- default: false
+# export ACCUMULO_MONITOR_BIND_ALL="true"
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7655de68/conf/examples/2GB/native-standalone/accumulo-env.sh
----------------------------------------------------------------------
diff --git a/conf/examples/2GB/native-standalone/accumulo-env.sh b/conf/examples/2GB/native-standalone/accumulo-env.sh
index d4294c5..bbad995 100755
--- a/conf/examples/2GB/native-standalone/accumulo-env.sh
+++ b/conf/examples/2GB/native-standalone/accumulo-env.sh
@@ -54,3 +54,6 @@ test -z "$ACCUMULO_OTHER_OPTS" && export ACCUMULO_OTHER_OPTS="-Xmx256m -Xms64m
export ACCUMULO_LOG_HOST=`(grep -v '^#' $ACCUMULO_HOME/conf/monitor ; echo localhost ) 2>/dev/null | head -1`
# what do when the JVM runs out of heap memory
export ACCUMULO_KILL_CMD='kill -9 %p'
+
+# Should the monitor bind to all network interfaces -- default: false
+# export ACCUMULO_MONITOR_BIND_ALL="true"
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7655de68/conf/examples/2GB/standalone/accumulo-env.sh
----------------------------------------------------------------------
diff --git a/conf/examples/2GB/standalone/accumulo-env.sh b/conf/examples/2GB/standalone/accumulo-env.sh
index 769971b..b9c14e0 100755
--- a/conf/examples/2GB/standalone/accumulo-env.sh
+++ b/conf/examples/2GB/standalone/accumulo-env.sh
@@ -55,3 +55,6 @@ test -z "$ACCUMULO_OTHER_OPTS" && export ACCUMULO_OTHER_OPTS="-Xmx256m -Xms64m
export ACCUMULO_LOG_HOST=`(grep -v '^#' $ACCUMULO_HOME/conf/monitor ; echo localhost ) 2>/dev/null | head -1`
# what do when the JVM runs out of heap memory
export ACCUMULO_KILL_CMD='kill -9 %p'
+
+# Should the monitor bind to all network interfaces -- default: false
+# export ACCUMULO_MONITOR_BIND_ALL="true"
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7655de68/conf/examples/3GB/native-standalone/accumulo-env.sh
----------------------------------------------------------------------
diff --git a/conf/examples/3GB/native-standalone/accumulo-env.sh b/conf/examples/3GB/native-standalone/accumulo-env.sh
index 6823306..a28892a 100755
--- a/conf/examples/3GB/native-standalone/accumulo-env.sh
+++ b/conf/examples/3GB/native-standalone/accumulo-env.sh
@@ -54,3 +54,6 @@ test -z "$ACCUMULO_OTHER_OPTS" && export ACCUMULO_OTHER_OPTS="-Xmx1g -Xms256m"
export ACCUMULO_LOG_HOST=`(grep -v '^#' $ACCUMULO_HOME/conf/monitor ; echo localhost ) 2>/dev/null | head -1`
# what do when the JVM runs out of heap memory
export ACCUMULO_KILL_CMD='kill -9 %p'
+
+# Should the monitor bind to all network interfaces -- default: false
+# export ACCUMULO_MONITOR_BIND_ALL="true"
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7655de68/conf/examples/3GB/standalone/accumulo-env.sh
----------------------------------------------------------------------
diff --git a/conf/examples/3GB/standalone/accumulo-env.sh b/conf/examples/3GB/standalone/accumulo-env.sh
index 44c6147..0c3672b 100755
--- a/conf/examples/3GB/standalone/accumulo-env.sh
+++ b/conf/examples/3GB/standalone/accumulo-env.sh
@@ -54,3 +54,6 @@ test -z "$ACCUMULO_OTHER_OPTS" && export ACCUMULO_OTHER_OPTS="-Xmx1g -Xms256m"
export ACCUMULO_LOG_HOST=`(grep -v '^#' $ACCUMULO_HOME/conf/monitor ; echo localhost ) 2>/dev/null | head -1`
# what do when the JVM runs out of heap memory
export ACCUMULO_KILL_CMD='kill -9 %p'
+
+# Should the monitor bind to all network interfaces -- default: false
+# export ACCUMULO_MONITOR_BIND_ALL="true"
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7655de68/conf/examples/512MB/native-standalone/accumulo-env.sh
----------------------------------------------------------------------
diff --git a/conf/examples/512MB/native-standalone/accumulo-env.sh b/conf/examples/512MB/native-standalone/accumulo-env.sh
index 275931c..7f32213 100755
--- a/conf/examples/512MB/native-standalone/accumulo-env.sh
+++ b/conf/examples/512MB/native-standalone/accumulo-env.sh
@@ -54,3 +54,6 @@ test -z "$ACCUMULO_OTHER_OPTS" && export ACCUMULO_OTHER_OPTS="-Xmx128m -Xms64m
export ACCUMULO_LOG_HOST=`(grep -v '^#' $ACCUMULO_HOME/conf/monitor ; echo localhost ) 2>/dev/null | head -1`
# what do when the JVM runs out of heap memory
export ACCUMULO_KILL_CMD='kill -9 %p'
+
+# Should the monitor bind to all network interfaces -- default: false
+# export ACCUMULO_MONITOR_BIND_ALL="true"
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7655de68/conf/examples/512MB/standalone/accumulo-env.sh
----------------------------------------------------------------------
diff --git a/conf/examples/512MB/standalone/accumulo-env.sh b/conf/examples/512MB/standalone/accumulo-env.sh
index 8bf637e..a4c95fc 100755
--- a/conf/examples/512MB/standalone/accumulo-env.sh
+++ b/conf/examples/512MB/standalone/accumulo-env.sh
@@ -54,3 +54,6 @@ test -z "$ACCUMULO_OTHER_OPTS" && export ACCUMULO_OTHER_OPTS="-Xmx128m -Xms64m
export ACCUMULO_LOG_HOST=`(grep -v '^#' $ACCUMULO_HOME/conf/monitor ; echo localhost ) 2>/dev/null | head -1`
# what do when the JVM runs out of heap memory
export ACCUMULO_KILL_CMD='kill -9 %p'
+
+# Should the monitor bind to all network interfaces -- default: false
+# export ACCUMULO_MONITOR_BIND_ALL="true"