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.
22 usage
="Usage: considerAsDead.sh --hostname serverName"
24 # if no args specified, show usage
30 bin
=`dirname "${BASH_SOURCE-$0}"`
31 bin
=`cd "$bin">/dev/null; pwd`
33 .
$bin/hbase-config.sh
38 remote_cmd
="cd ${HBASE_HOME}; $bin/hbase-daemon.sh --config ${HBASE_CONF_DIR} restart"
40 zparent
=`$bin/hbase org.apache.hadoop.hbase.util.HBaseConfTool zookeeper.znode.parent`
41 if [ "$zparent" == "null" ]; then zparent
="/hbase"; fi
43 zkrs
=`$bin/hbase org.apache.hadoop.hbase.util.HBaseConfTool zookeeper.znode.rs`
44 if [ "$zkrs" == "null" ]; then zkrs
="rs"; fi
47 online_regionservers
=`$bin/hbase zkcli ls $zkrs 2>&1 | tail -1 | sed "s/\[//" | sed "s/\]//"`
48 for rs
in $online_regionservers
51 hostname
=${rs_parts[0]}
54 if [ "$deadhost" == "$hostname" ]; then
56 echo "ZNode Deleting:" $znode
57 $bin/hbase zkcli delete
$znode > /dev
/null
2>&1
59 ssh $HBASE_SSH_OPTS $hostname $remote_cmd 2>&1 |
sed "s/^/$hostname: /"