3 # * Licensed to the Apache Software Foundation (ASF) under one
4 # * or more contributor license agreements. See the NOTICE file
5 # * distributed with this work for additional information
6 # * regarding copyright ownership. The ASF licenses this file
7 # * to you under the Apache License, Version 2.0 (the
8 # * "License"); you may not use this file except in compliance
9 # * with the License. You may obtain a copy of the License at
11 # * http://www.apache.org/licenses/LICENSE-2.0
13 # * Unless required by applicable law or agreed to in writing, software
14 # * distributed under the License is distributed on an "AS IS" BASIS,
15 # * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # * See the License for the specific language governing permissions and
17 # * limitations under the License.
19 # This is used for starting multiple masters on the same machine.
20 # run it from hbase-dir/ just like 'bin/hbase'
21 # Supports up to 10 masters (limitation = overlapping ports)
23 bin
=`dirname "${BASH_SOURCE-$0}"`
24 bin
=`cd "$bin" >/dev/null && pwd`
27 S
=`basename "${BASH_SOURCE-$0}"`
28 echo "Usage: $S [--config <conf-dir>] [--autostart-window-size <window size in hours>]"
29 echo " [--autostart-window-retry-limit <retry count limit for autostart>] [autostart|start|stop] offset(s)"
30 echo " e.g. $S start 1"
34 # default autostart args value indicating infinite window size and no retry limit
35 AUTOSTART_WINDOW_SIZE
=0
36 AUTOSTART_WINDOW_RETRY_LIMIT
=0
38 .
"$bin"/hbase-config.sh
40 # sanity check: make sure your master opts don't use ports [i.e. JMX/DBG]
41 export HBASE_MASTER_OPTS
=" "
45 export HBASE_IDENT_STRING
="$USER-$DN"
47 -D hbase.master.port=`expr 16000 + $DN` \
48 -D hbase.master.info.port=`expr 16010 + $DN` \
49 -D hbase.regionserver.port=`expr 16020 + $DN` \
50 -D hbase.regionserver.info.port=`expr 16030 + $DN` \
52 "$bin"/hbase-daemon.sh
--config "${HBASE_CONF_DIR}" --autostart-window-size "${AUTOSTART_WINDOW_SIZE}" --autostart-window-retry-limit "${AUTOSTART_WINDOW_RETRY_LIMIT}" $1 master
$HBASE_MASTER_ARGS
60 if [[ "$i" =~ ^
[0-9]+$
]]; then
63 echo "Invalid argument"