1.#思路:status可以看到dead 0说明集群健康;list列出重要表名也说明集群健康。

#在hbase服务器上加crontab

1 */2 * * * /bin/bash /tmp/hbase_status.sh > /tmp/status_hbase.txt
1 */10 * * * /bin/bash /tmp/hbase_table.sh > /tmp/table_hbase.txt

cat /tmp/hbase_status.sh
#!/bin/bash
/usr/bin/hbase shell <<EOF
status
EOF

cat /tmp/hbase_table.sh
#!/bin/bash
/usr/bin/hbase shell <<EOF
list
EOF

2.#在蓝鲸web页面添加自定义监控

#!/bin/bash
#在蓝鲸web页面添加自定义监控
status=`egrep -c 'dead 0' /tmp/status.txt`
table=`egrep -c '替换成重要表名' /tmp/hbase.txt`
hbase_status=1
if [ $table -ne 2 $b ] && [ $status -ne 1 ] ;then
hbase_status=0
fi
echo "hbase_health{hostname_name=\"10.51.86.13(hbase-ip)\"} ${hbase_status}"

相关文章:

  • 2022-12-23
  • 2021-09-13
  • 2021-08-05
  • 2021-11-15
  • 2021-07-11
  • 2022-12-23
  • 2021-05-31
猜你喜欢
  • 2022-01-01
  • 2021-12-19
  • 2022-12-23
  • 2022-12-23
  • 2021-10-16
  • 2021-06-05
  • 2022-12-23
相关资源
相似解决方案