Support Questions

Find answers, ask questions, and share your expertise

API to stop only metrics collector

avatar

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

avatar
Master 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

avatar
Master 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!!