4 # * Licensed to the Apache Software Foundation (ASF) under one
5 # * or more contributor license agreements. See the NOTICE file
6 # * distributed with this work for additional information
7 # * regarding copyright ownership. The ASF licenses this file
8 # * to you under the Apache License, Version 2.0 (the
9 # * "License"); you may not use this file except in compliance
10 # * with the License. You may obtain a copy of the License at
12 # * http://www.apache.org/licenses/LICENSE-2.0
14 # * Unless required by applicable law or agreed to in writing, software
15 # * distributed under the License is distributed on an "AS IS" BASIS,
16 # * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 # * See the License for the specific language governing permissions and
18 # * limitations under the License.
21 # Run a hbase command on all slave hosts.
22 # Modelled after $HADOOP_HOME/bin/hadoop-daemons.sh
24 usage
="Usage: hbase-daemons.sh [--config <hbase-confdir>] [--autostart-window-size <window size in hours>]\
25 [--autostart-window-retry-limit <retry count limit for autostart>] \
26 [--hosts regionserversfile] [autostart|autorestart|restart|start|stop] command args..."
28 # if no args specified, show usage
34 bin
=`dirname "${BASH_SOURCE-$0}"`
35 bin
=`cd "$bin">/dev/null; pwd`
37 # default autostart args value indicating infinite window size and no retry limit
38 AUTOSTART_WINDOW_SIZE
=0
39 AUTOSTART_WINDOW_RETRY_LIMIT
=0
41 .
$bin/hbase-config.sh
43 if [[ "$1" = "autostart" ||
"$1" = "autorestart" ]]
45 autostart_args
="--autostart-window-size ${AUTOSTART_WINDOW_SIZE} --autostart-window-retry-limit ${AUTOSTART_WINDOW_RETRY_LIMIT}"
48 remote_cmd
="$bin/hbase-daemon.sh --config ${HBASE_CONF_DIR} ${autostart_args} $@"
49 args
="--hosts ${HBASE_REGIONSERVERS} --config ${HBASE_CONF_DIR} $remote_cmd"
54 exec "$bin/zookeepers.sh" $args
57 exec "$bin/master-backup.sh" $args
60 exec "$bin/regionservers.sh" $args