#!/usr/bin/env bash # #/** # * Licensed to the Apache Software Foundation (ASF) under one # * or more contributor license agreements. See the NOTICE file # * distributed with this work for additional information # * regarding copyright ownership. The ASF licenses this file # * to you under the Apache License, Version 2.0 (the # * "License"); you may not use this file except in compliance # * with the License. You may obtain a copy of the License at # * # * http://www.apache.org/licenses/LICENSE-2.0 # * # * Unless required by applicable law or agreed to in writing, software # * distributed under the License is distributed on an "AS IS" BASIS, # * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # * See the License for the specific language governing permissions and # * limitations under the License. # */ # Modelled after $HADOOP_HOME/bin/start-hbase.sh. # Start hadoop hbase daemons. # Run this on master node. usage="Usage: start-hbase.sh [--autostart-window-size <window size in hours>]\ [--autostart-window-retry-limit <retry count limit for autostart>]\ [autostart|start]" bin=`dirname "${BASH_SOURCE-$0}"` bin=`cd "$bin">/dev/null; pwd` # default autostart args value indicating infinite window size and no retry limit AUTOSTART_WINDOW_SIZE=0 AUTOSTART_WINDOW_RETRY_LIMIT=0 . "$bin"/hbase-config.sh # start hbase daemons errCode=$? if [ $errCode -ne 0 ] then exit $errCode fi if [ "$1" = "autostart" ] then commandToRun="--autostart-window-size ${AUTOSTART_WINDOW_SIZE} --autostart-window-retry-limit ${AUTOSTART_WINDOW_RETRY_LIMIT} autostart" else commandToRun="start" fi # HBASE-6504 - only take the first line of the output in case verbose gc is on distMode=`$bin/hbase --config "$HBASE_CONF_DIR" org.apache.hadoop.hbase.util.HBaseConfTool hbase.cluster.distributed | head -n 1` if [ "$distMode" == 'false' ] then "$bin"/hbase-daemon.sh --config "${HBASE_CONF_DIR}" $commandToRun master else "$bin"/hbase-daemons.sh --config "${HBASE_CONF_DIR}" $commandToRun zookeeper "$bin"/hbase-daemon.sh --config "${HBASE_CONF_DIR}" $commandToRun master "$bin"/hbase-daemons.sh --config "${HBASE_CONF_DIR}" \ --hosts "${HBASE_REGIONSERVERS}" $commandToRun regionserver "$bin"/hbase-daemons.sh --config "${HBASE_CONF_DIR}" \ --hosts "${HBASE_BACKUP_MASTERS}" $commandToRun master-backup fi
最主要找jvm启动参数,翻译后的脚本
#! /usr/bin/env bash # # / * * # *授权给Apache软件基金会(ASF) # *或更多的贡献者许可协议。 参见NOTICE文件 # *与本作品一起分发,以获得更多信息 # *关于版权所有权。 ASF授权此文件 # *在Apache许可证,版本2.0 ( # *“许可证”); 除非符合规定,否则你不能使用这个文件 # *与许可证。 您可以在以下网址获得许可证的副本 # * # * http://www.apache.org/licenses/license - 2.0 # * # *除非适用法律要求或书面同意,软件 # *在许可证下发布是在“现状”的基础上发布的, # *没有任何明示或暗示的保证或条件。 # *请参阅许可证的特定语言管理权限和 # *许可证下的限制。 # * / #在$HADOOP_HOME/bin/start-hbase.sh后面建模。 #启动hadoop hbase守护进程。 #在主节点上运行。 usage=" usage: start-hbase.sh[——autostart-window-size <以小时计算的窗口大小>]\ [——autostart-window-retry-limit <retry count limit for autostart>]\ (自动启动|开始)” 本= '目录名“$ {BASH_SOURCE - $ 0} " 本= ' cd " $本" > / dev / null; 松材线虫病的 #默认自动启动参数值,表示无限窗口大小和没有重试限制 AUTOSTART_WINDOW_SIZE = 0 AUTOSTART_WINDOW_RETRY_LIMIT = 0 . " $本" / hbase-config.sh #启动hbase守护进程 errCode = $ ? if [$errCode -ne 0] 然后 退出errCode美元 fi 如果["$1" = "autostart"] 然后 commandToRun="——autostart-window-size ${AUTOSTART_WINDOW_SIZE}——autostart-window-retry-limit ${AUTOSTART_WINDOW_RETRY_LIMIT} autostart" 其他的 commandToRun = "开始" fi # HBASE-6504—在启用verbose gc的情况下,只使用输出的第一行 $bin/hbase——config "$HBASE_CONF_DIR" org.apache.hadoop.hbase.util.HBaseConfTool hbase.cluster.distributed | head -n 1 ' if ["$distMode" == 'false'] 然后 "$bin"/hbase-daemon.sh——config "${HBASE_CONF_DIR} 其他的 "$bin"/hbase-daemons.sh——config "${HBASE_CONF_DIR}" $commandToRun zookeeper .sh "$bin"/hbase-daemon.sh——config "${HBASE_CONF_DIR} "$bin"/hbase-daemons.sh——config "${HBASE_CONF_DIR}" \ ——hosts“${HBASE_REGIONSERVERS} "$bin"/hbase-daemons.sh——config "${HBASE_CONF_DIR}" \ ——hosts "${HBASE_BACKUP_MASTERS} fi 最主要找jvm启动参数,