4 # * Copyright The Apache Software Foundation
6 # * Licensed to the Apache Software Foundation (ASF) under one
7 # * or more contributor license agreements. See the NOTICE file
8 # * distributed with this work for additional information
9 # * regarding copyright ownership. The ASF licenses this file
10 # * to you under the Apache License, Version 2.0 (the
11 # * "License"); you may not use this file except in compliance
12 # * with the License. You may obtain a copy of the License at
14 # * http://www.apache.org/licenses/LICENSE-2.0
16 # * Unless required by applicable law or agreed to in writing, software
17 # * distributed under the License is distributed on an "AS IS" BASIS,
18 # * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 # * See the License for the specific language governing permissions and
20 # * limitations under the License.
26 SCRIPT_DIR
=$
(cd `dirname $0` && pwd )
30 Usage: $SCRIPT_NAME <options>
33 Kill local process-based HBase cluster using pid files.
35 Show HBase processes running on this machine
41 ps
-ef |
grep -P "(HRegionServer|HMaster|HQuorumPeer) start" |
grep -v grep
45 if [ "$CMD_SPECIFIED" ]; then
46 echo "Only one command can be specified" >&2
53 LOCAL_CLUSTER_DIR
=$SCRIPT_DIR/..
/..
/target
/local_cluster
54 LOCAL_CLUSTER_DIR
=$
( cd $LOCAL_CLUSTER_DIR && pwd )
55 find $LOCAL_CLUSTER_DIR -name "*.pid"
66 while [ $# -ne 0 ]; do
77 echo "Invalid option: $1" >&2
83 if [ "$IS_KILL" ]; then
87 echo "Killing pid $PID from file $F"
88 # Kill may fail but that's OK, so turn off error handling for a moment.
93 elif [ "$IS_SHOW" ]; then
95 for F
in `list_pid_files`; do
97 if [ -n "$PID" ]; then
98 if [ -n "$PIDS" ]; then
106 echo "No command specified" >&2