HADOOP-1931 Hbase scripts take --ARG=ARG_VALUE when should be like

hadoop and do ---ARG ARG_VALUE


git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk/src/contrib/hbase@578032 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2007-09-21 09:27:46 +00:00
parent f81060229f
commit 4038ec9102
7 changed files with 52 additions and 45 deletions

View File

@ -4,6 +4,8 @@ HBase Change Log
Trunk (unreleased changes) Trunk (unreleased changes)
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES
HADOOP-1931 Hbase scripts take --ARG=ARG_VALUE when should be like hadoop
and do ---ARG ARG_VALUE
NEW FEATURES NEW FEATURES
HADOOP-1768 FS command using Hadoop FsShell operations HADOOP-1768 FS command using Hadoop FsShell operations

View File

@ -49,29 +49,34 @@ export HBASE_HOME=`dirname "$this"`/..
#check to see if the conf dir or hadoop home are given as an optional arguments #check to see if the conf dir or hadoop home are given as an optional arguments
while [ $# -gt 1 ] while [ $# -gt 1 ]
do do
case $1 in if [ "--config" = "$1" ]
--config=*) then
HADOOP_CONF_DIR=`echo $1|sed 's/[^=]*=\(.*\)/\1/'` shift
shift confdir=$1
;; shift
--hbaseconfig=*) HADOOP_CONF_DIR=$confdir
HBASE_CONF_DIR=`echo $1|sed 's/[^=]*=\(.*\)/\1/'` elif [ "--hbaseconfig" = "$1" ]
shift then
;; shift
confdir=$1
--hadoop=*) shift
HADOOP_HOME=`echo $1|sed 's/[^=]*=\(.*\)/\1/'` HBASE_CONF_DIR=$confdir
shift elif [ "--hadoop" = "$1" ]
;; then
--hosts=*) shift
HBASE_REGIONSERVERS=`echo $1|sed 's/[^=]*=\(.*\)/\1/'` home=$1
shift shift
;; HADOOP_HOME=$home
elif [ "--hosts" = "$1" ]
*) then
break shift
;; hosts=$1
esac shift
HBASE_REGIONSERVERS=$hosts
else
# Presume we are at end of options and break
break
fi
done done
# If no hadoop home specified, then we assume its above this directory. # If no hadoop home specified, then we assume its above this directory.

View File

@ -33,8 +33,8 @@
# #
# Modelled after $HADOOP_HOME/bin/hadoop-daemon.sh # Modelled after $HADOOP_HOME/bin/hadoop-daemon.sh
usage="Usage: hbase-daemon.sh [--config=<hadoop-conf-dir>]\ usage="Usage: hbase-daemon.sh [--config <hadoop-conf-dir>]\
[--hbaseconfig=<hbase-conf-dir>] <hbase-command> (start|stop)\ [--hbaseconfig <hbase-conf-dir>] <hbase-command> (start|stop)\
<args...>" <args...>"
# if no args specified, show usage # if no args specified, show usage
@ -117,8 +117,8 @@ case $startStop in
hbase_rotate_log $log hbase_rotate_log $log
echo starting $command, logging to $log echo starting $command, logging to $log
nohup nice -n $HADOOP_NICENESS "$HBASE_HOME"/bin/hbase \ nohup nice -n $HADOOP_NICENESS "$HBASE_HOME"/bin/hbase \
--hadoop="${HADOOP_HOME}" \ --hadoop "${HADOOP_HOME}" \
--config="${HADOOP_CONF_DIR}" --hbaseconfig="${HBASE_CONF_DIR}" \ --config "${HADOOP_CONF_DIR}" --hbaseconfig "${HBASE_CONF_DIR}" \
$command $startStop "$@" > "$log" 2>&1 < /dev/null & $command $startStop "$@" > "$log" 2>&1 < /dev/null &
echo $! > $pid echo $! > $pid
sleep 1; head "$log" sleep 1; head "$log"
@ -129,8 +129,8 @@ case $startStop in
if kill -0 `cat $pid` > /dev/null 2>&1; then if kill -0 `cat $pid` > /dev/null 2>&1; then
echo -n stopping $command echo -n stopping $command
nohup nice -n $HADOOP_NICENESS "$HBASE_HOME"/bin/hbase \ nohup nice -n $HADOOP_NICENESS "$HBASE_HOME"/bin/hbase \
--hadoop="${HADOOP_HOME}" \ --hadoop "${HADOOP_HOME}" \
--config="${HADOOP_CONF_DIR}" --hbaseconfig="${HBASE_CONF_DIR}" \ --config "${HADOOP_CONF_DIR}" --hbaseconfig "${HBASE_CONF_DIR}" \
$command $startStop "$@" > "$log" 2>&1 < /dev/null & $command $startStop "$@" > "$log" 2>&1 < /dev/null &
while kill -0 `cat $pid` > /dev/null 2>&1; do while kill -0 `cat $pid` > /dev/null 2>&1; do
echo -n "." echo -n "."

View File

@ -23,9 +23,9 @@
# Run a Hadoop hbase command on all slave hosts. # Run a Hadoop hbase command on all slave hosts.
# Modelled after $HADOOP_HOME/bin/hadoop-daemons.sh # Modelled after $HADOOP_HOME/bin/hadoop-daemons.sh
usage="Usage: hbase-daemons.sh [--hadoop=<hadoop-home>] usage="Usage: hbase-daemons.sh [--hadoop <hadoop-home>]
[--config=<hadoop-confdir>] [--hbase=<hbase-home>]\ [--config <hadoop-confdir>] [--hbase <hbase-home>]\
[--hbaseconfig=<hbase-confdir>] [--hosts=regionserversfile]\ [--hbaseconfig <hbase-confdir>] [--hosts regionserversfile]\
command [start|stop] args..." command [start|stop] args..."
# if no args specified, show usage # if no args specified, show usage
@ -39,8 +39,8 @@ bin=`cd "$bin"; pwd`
. $bin/hbase-config.sh . $bin/hbase-config.sh
exec "$bin/regionservers.sh" --config="${HADOOP_CONF_DIR}" \ exec "$bin/regionservers.sh" --config "${HADOOP_CONF_DIR}" \
--hbaseconfig="${HBASE_CONF_DIR}" --hadoop="${HADOOP_HOME}" \ --hbaseconfig "${HBASE_CONF_DIR}" --hadoop "${HADOOP_HOME}" \
cd "${HBASE_HOME}" \; \ cd "${HBASE_HOME}" \; \
"$bin/hbase-daemon.sh" --config="${HADOOP_CONF_DIR}" \ "$bin/hbase-daemon.sh" --config "${HADOOP_CONF_DIR}" \
--hbaseconfig="${HBASE_CONF_DIR}" --hadoop="${HADOOP_HOME}" "$@" --hbaseconfig "${HBASE_CONF_DIR}" --hadoop "${HADOOP_HOME}" "$@"

View File

@ -33,8 +33,8 @@
# #
# Modelled after $HADOOP_HOME/bin/slaves.sh. # Modelled after $HADOOP_HOME/bin/slaves.sh.
usage="Usage: regionservers [--config=<hadoop-confdir>]\ usage="Usage: regionservers [--config <hadoop-confdir>]\
[--hbaseconfig=<hbase-confdir>] command..." [--hbaseconfig <hbase-confdir>] command..."
# if no args specified, show usage # if no args specified, show usage
if [ $# -le 0 ]; then if [ $# -le 0 ]; then

View File

@ -38,8 +38,8 @@ if [ $errCode -ne 0 ]
then then
exit $errCode exit $errCode
fi fi
"$bin"/hbase-daemon.sh --config="${HADOOP_CONF_DIR}" \ "$bin"/hbase-daemon.sh --config "${HADOOP_CONF_DIR}" \
--hbaseconfig="${HBASE_CONF_DIR}" master start --hbaseconfig "${HBASE_CONF_DIR}" master start
"$bin"/hbase-daemons.sh --config="${HADOOP_CONF_DIR}" \ "$bin"/hbase-daemons.sh --config "${HADOOP_CONF_DIR}" \
--hbaseconfig="${HBASE_CONF_DIR}" --hadoop="${HADOOP_HOME}" \ --hbaseconfig "${HBASE_CONF_DIR}" --hadoop "${HADOOP_HOME}" \
--hosts="${HBASE_REGIONSERVERS}" regionserver start --hosts "${HBASE_REGIONSERVERS}" regionserver start

View File

@ -29,5 +29,5 @@ bin=`cd "$bin"; pwd`
. "$bin"/hbase-config.sh . "$bin"/hbase-config.sh
"$bin"/hbase-daemon.sh --config="${HADOOP_CONF_DIR}" \ "$bin"/hbase-daemon.sh --config "${HADOOP_CONF_DIR}" \
--hbaseconfig="${HBASE_CONF_DIR}" master stop --hbaseconfig "${HBASE_CONF_DIR}" master stop