How to verify service statuses via Ambari?
For example, I want to check in Ambari if the HDFS service is stopped or has been STARTED
.
Until now I use the following syntax in order to check the service status:
ENDPOINT="http://${SERVER}:${PORT}/api/v1/clusters/${CLUSTERNAME}/services/${SERVICE}"
curl --silent -u admin:admin -X GET ${ENDPOINT}?fields=ServiceInfo | grep state
But I do not get the output about stopped/STARTED
, as you can see from commands results. What we only get is INSTALLED
:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1207 100 1207 0 0 28158 0 --:--:-- --:--:-- --:--:-- 28738
Checking HIVE
{
"href" : "http://master02.ipmassanalyt41.com:8080/api/v1/clusters/HDP26/services/HIVE?fields=ServiceInfo",
"ServiceInfo" : {
"cluster_name" : "HDP26",
"credential_store_enabled" : "true",
"credential_store_supported" : "true",
"maintenance_state" : "OFF",
"service_name" : "HIVE",
"state" : "INSTALLED"
}