#!/bin/bash bin=`dirname "$0"` bin=`cd "$bin">/dev/null; pwd` #Find server hosting -ROOT- table IProot=`$bin/hbase zkcli get /hbase/root-region-server 2>&1 | grep -B 1 "cZxid" | grep ":" | cut -d":" -f1` if [ -z "$IProot" ]; then echo "Unable read ZK info to locate RS that is holding -ROOT- table." else echo "[+] -ROOT- table is deployed on $IProot" fi #Find server hosting .META. table IPmeta=`echo "scan '-ROOT-'" | "$bin"/hbase shell 2>&1 | grep "column=info:server," | awk '{print $4}' | cut -d "=" -f2 | cut -d ":" -f1` if [ -z "$IPmeta" ]; then echo "Unable to read -ROOT- table to locate RS that is holding .META. table." else echo "[+] .META. table is deployed on $IPmeta" fi