Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

REST API + how to check by API if one component or more is down/stop

REST API + how to check by API if one component or more is down/stop

is it possible to check by REST API if one or more of the component are down?

for example if one component or more then 1 is down then we get false results

we get only true status if all component are up

Michael-Bronson
1 REPLY 1

Re: REST API + how to check by API if one component or more is down/stop

Expert Contributor
@Michael Bronson

Ambari API dos not have a support to return boolean true or false as result for the asked question.

The nearest information that you can get from ambari API is as below and then you will need to have small client side logic to calculate the boolean

1. Ambari API to return list of all components in the cluster that are down

http://localhost:8080/api/v1/clusters/c4/components?(ServiceComponentInfo/init_count!=0|ServiceCompo...

The response to above APIs will look like as below and implies that some instances of DataNode and NodeManager are down. We can ofcourse also know which one specifically are down but it seems as per the question that it is not of interest.

{items: [    {    ServiceComponentInfo: {        component_name: "DATANODE"      }    },    {    ServiceComponentInfo: {        component_name: "NODEMANAGER"    }  }  ]}

2. Ambari API to return list of all components of a specific service (HDFS in below example) that are down

http://localhost:8080/api/v1/clusters/c4/components?(ServiceComponentInfo/init_count!=0|ServiceCompo...

Note: Replace localhost with ambari server host name

Don't have an account?
Coming from Hortonworks? Activate your account here