blob: f2c7c587ff1c588fd6ed7b22fc971a5dc3ca2c58 [file] [log] [blame]
gfrabonibe779fa2017-09-19 13:25:30 -04001
2# Query the Hbase service for the cluster status.
Priyanka Jain1fda9682018-05-09 08:42:50 +00003GET_CLUSTER_STATUS_RESPONSE=$(curl -si -X GET -H "Accept: text/xml" http://aai-hbase:8080/status/cluster)
gfrabonibe779fa2017-09-19 13:25:30 -04004
5if [ -z "$GET_CLUSTER_STATUS_RESPONSE" ]; then
6 echo "Tabular store is unreachable."
Priyanka Jain1fda9682018-05-09 08:42:50 +00007 return 2
gfrabonibe779fa2017-09-19 13:25:30 -04008fi
9
Priyanka Jain1fda9682018-05-09 08:42:50 +000010# Check the resulting status JSON to see if there is a 'DeadNodes' stanza with
gfrabonibe779fa2017-09-19 13:25:30 -040011# 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