blob: dc7768fc6e4dd77c9eb10cd75b4fa846c8053543 [file] [log] [blame]
gfrabonibe779fa2017-09-19 13:25:30 -04001
2# Query the Hbase service for the cluster status.
jasmineWen85d9d732018-03-06 16:13:35 +00003GET_CLUSTER_STATUS_RESPONSE=$(curl -si -X GET -H "Accept: text/xml" http://hbase.{{ .Values.nsPrefix }}: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