HBase RegionServer服务监控,并自动恢复启动 1.服务端centos7安装jq,用于解析json数据 wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm rpm -ivh epel-release-latest-7.noarch.rpm yum search jq yum install -y jq.x86_64 2.确保hbase REST处于启动状态 /usr/hdp/current/hbase-master/bin/hbase-daemon.sh start rest 3.获取hbase上DeadNodes curl -H "Accept: application/json" http://${server}:8000/status/cluster 4.使用jq+awk解析字符串 5.使用ambari REST api来启动RegionServer curl -u admin:admin -i -H 'X-Requested-By: ambari' -X PUT -d '{"RequestInfo":{"context":"Start RegionServer","operation_level":{"level":"HOST_COMPONENT","cluster_name":"magneto","host_name":"${node}","service_name":"HBASE"}},"Body":{"HostRoles":{"state":"STARTED"}}}' ${api}
转载于:https://my.oschina.net/zstorm/blog/1582184