Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

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