Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

API + how the get status summary for all services in ambari cluster

avatar

how the get status summary details for services in ambari cluster by rest API commands


example for kafka service ( kafka broker summary )

47420-capture5.png

let take the HDFS service as example

HDFS include the following sub application/services

so how to get status started/stop for "Standby NameNode" , ZKFailoverController , Active NameNode , etc

the same for all rest services

47419-capture4.png

47418-capture4.png

47417-capture3.png

47416-capture2.png

47415-capture1.png

Michael-Bronson
1 ACCEPTED SOLUTION

avatar
Contributor
@Michael Bronson

This API will get you status of all components on all hosts in your cluster

curl -u {ambari_username}:{ambari_password} -H "X-Requested-By:ambari" -i GET http://localhost:8080/api/v1/clusters/cl1/components?fields=host_components/HostRoles/state

And if you need to find the status of individual component e.g for datanode;

curl -u {ambari_username}:{ambari_password} -H "X-Requested-By:ambari" -i GET http://localhost:8080/api/v1/clusters/cl1/components/DATANODE?fields=host_components/HostRoles/state

Hope this helps!

View solution in original post

3 REPLIES 3

avatar
Contributor

avatar
Contributor
@Michael Bronson

This API will get you status of all components on all hosts in your cluster

curl -u {ambari_username}:{ambari_password} -H "X-Requested-By:ambari" -i GET http://localhost:8080/api/v1/clusters/cl1/components?fields=host_components/HostRoles/state

And if you need to find the status of individual component e.g for datanode;

curl -u {ambari_username}:{ambari_password} -H "X-Requested-By:ambari" -i GET http://localhost:8080/api/v1/clusters/cl1/components/DATANODE?fields=host_components/HostRoles/state

Hope this helps!

avatar
New Contributor

curl -u *********:************** -H "X-Requested-By:ambari" -i GET http://bathdi-pp-ne-petra-hive-prod-02.azurehdinsight.net:8080/api/v1/clusters/cl1/components?fields...

 

 

Getting error : curl: (6) Could not resolve host: GET