Support Questions
Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Innovation Accelerator group hub.

API to stop only metrics collector

what is the API to stop the Metrics Collector ?


I ask this API because the API that should to the ambari metrics some times missed to stop the Metrics Collector


67424-capture.png

Michael-Bronson
1 ACCEPTED SOLUTION

Mentor

@Michael Bronson

You will need first to identify the Ambari Service and Component name to be used in the API, this for sure will also bring down the Metrics collector

curl -u admin:admin get http://<AMBARI_SERVER>:8080/api/v1/clusters/<CLUSTER_NAME>/services 

Replace the particular service below <Service_name> with the previous output eg AMBARI_METRICS

Stop AMBARI_METRICS

curl -u admin:admin  -H 'X-Requested-By: ambari' -X PUT -d '{"RequestInfo": {"context" :"Stop service "}, "Body": {"ServiceInfo": {"state": "INSTALLED"}}}' http://<AMBARI_SERVER_HOSTNAME>:8080/api/v1/clusters/<CLUSTER_NAME>/services/<Service_name>;

The service will stop check the Ambari UI

Hope that helps!!

View solution in original post

1 REPLY 1

Mentor

@Michael Bronson

You will need first to identify the Ambari Service and Component name to be used in the API, this for sure will also bring down the Metrics collector

curl -u admin:admin get http://<AMBARI_SERVER>:8080/api/v1/clusters/<CLUSTER_NAME>/services 

Replace the particular service below <Service_name> with the previous output eg AMBARI_METRICS

Stop AMBARI_METRICS

curl -u admin:admin  -H 'X-Requested-By: ambari' -X PUT -d '{"RequestInfo": {"context" :"Stop service "}, "Body": {"ServiceInfo": {"state": "INSTALLED"}}}' http://<AMBARI_SERVER_HOSTNAME>:8080/api/v1/clusters/<CLUSTER_NAME>/services/<Service_name>;

The service will stop check the Ambari UI

Hope that helps!!