blob: fe21db504b6a218435b3f69638ae1f04eb478c49 [file] [log] [blame]
gfrabonibe779fa2017-09-19 13:25:30 -04001
2# Query the Hbase service for the cluster status.
Priyanka Jainc07e1d12018-05-03 12:52:04 +00003GET_CLUSTER_STATUS_RESPONSE=$(curl -si -X GET -H "Accept: text/xml" http://hbase:8080/status/cluster)
gfrabonibe779fa2017-09-19 13:25:30 -04004
5if [ -z "$GET_CLUSTER_STATUS_RESPONSE" ]; then
6 echo "Tabular store is unreachable."
7 return 2
8fi
9
10# Check the resulting status JSON to see if there is a 'DeadNodes' stanza with
11# entries.
12DEAD_NODES=$(echo $GET_CLUSTER_STATUS_RESPONSE | grep "<DeadNodes/>")
13
14if [ -n "$DEAD_NODES" ]; then
15 echo "Tabular store is up and accessible."
16 return 0
17else
18 echo "Tabular store is up but is reporting dead nodes - cluster may be in degraded state."
19 return 1
20fi