2010-07-19 18:59:51 -04:00
|
|
|
#!/bin/sh
|
|
|
|
# This is used for starting multiple masters on the same machine.
|
|
|
|
# run it from hbase-dir/ just like 'bin/hbase'
|
|
|
|
# Supports up to 10 masters (limitation = overlapping ports)
|
|
|
|
|
2010-07-27 17:50:05 -04:00
|
|
|
bin=`dirname "${BASH_SOURCE-$0}"`
|
2010-07-19 18:59:51 -04:00
|
|
|
bin=`cd "$bin" >/dev/null && pwd`
|
|
|
|
|
|
|
|
if [ $# -lt 2 ]; then
|
2010-07-27 17:50:05 -04:00
|
|
|
S=`basename "${BASH_SOURCE-$0}"`
|
2010-07-19 18:59:51 -04:00
|
|
|
echo "Usage: $S [start|stop] offset(s)"
|
|
|
|
echo ""
|
|
|
|
echo " e.g. $S start 1"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
# sanity check: make sure your master opts don't use ports [i.e. JMX/DBG]
|
|
|
|
export HBASE_MASTER_OPTS=" "
|
|
|
|
|
|
|
|
run_master () {
|
|
|
|
DN=$2
|
|
|
|
export HBASE_IDENT_STRING="$USER-$DN"
|
|
|
|
HBASE_MASTER_ARGS="\
|
|
|
|
-D hbase.master.port=`expr 60000 + $DN` \
|
2011-06-25 20:52:36 -04:00
|
|
|
-D hbase.master.info.port=`expr 60010 + $DN` \
|
|
|
|
--backup"
|
2010-07-19 18:59:51 -04:00
|
|
|
"$bin"/hbase-daemon.sh $1 master $HBASE_MASTER_ARGS
|
|
|
|
}
|
|
|
|
|
|
|
|
cmd=$1
|
|
|
|
shift;
|
|
|
|
|
|
|
|
for i in $*
|
|
|
|
do
|
|
|
|
run_master $cmd $i
|
|
|
|
done
|