HBASE-23187 Update parent region state to SPLIT in meta (#732)
[hbase.git] / bin / local-master-backup.sh
blobb0aa2f7880bfa0969a5015fe916e4833c266218b
1 #!/usr/bin/env bash
2 #/**
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
10 # *
11 # * http://www.apache.org/licenses/LICENSE-2.0
12 # *
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.
18 # */
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`
26 if [ $# -lt 2 ]; then
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"
31 exit
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=" "
43 run_master () {
44 DN=$2
45 export HBASE_IDENT_STRING="$USER-$DN"
46 HBASE_MASTER_ARGS="\
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` \
51 --backup"
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
55 cmd=$1
56 shift;
58 for i in $*
60 if [[ "$i" =~ ^[0-9]+$ ]]; then
61 run_master $cmd $i
62 else
63 echo "Invalid argument"
65 done