How to delete Grafana?
To remove a already installed Grafana, following needs to be done:
1. Stop the AMS service from Ambari UI.
2. Execute following curl API commands to delete Grafana:
# curl -u admin:admin -i -H 'X-Requested-By: ambari' -X PUT -d '{"RequestInfo": {"context" :"Stop HDFS via REST"}, "Body": {"ServiceInfo": {"state": "INSTALLED"}}}' http://<strong><ambari-server-hostname></strong>:8080/api/v1/clusters/<strong><CLUSTERNAME></strong>/services/AMBARI_METRICS/components/METRICS_GRAFANA
# curl -u admin:admin -i -H 'X-Requested-By: ambari' -X PUT -d '{"RequestInfo": {"context" :"Stop HDFS via REST"}, "Body": {"ServiceInfo": {"state": "INSTALLED"}}}' http://<strong><ambari-server-hostname></strong>:8080/api/v1/clusters/<strong><CLUSTERNAME></strong>/services/AMBARI_METRICS/
# curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://<strong><ambari-server-hostname></strong>:8080/api/v1/clusters/<strong><CLUSTERNAME></strong>/hosts/<strong><hostname_of_Grafana_host></strong>/host_components/METRICS_GRAFANA
# curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://<strong><ambari-server-hostname></strong>:8080/api/v1/clusters/<strong><CLUSTERNAME></strong>/services/AMBARI_METRICS/components/METRICS_GRAFANA
# curl -u admin:admin -X GET http://<strong><ambari-server-hostname></strong>:8080/api/v1/clusters/<strong><CLUSTERNAME></strong>/services/AMBARI_METRICS/components/METRICS_GRAFANA
3. Start the AMS service from Ambari UI.
Here:
Replace following :
<ambari-server-hostname> = FullyqualifiedDomain Nameof the node running Ambari Server
<CLUSTERNAME> = Name of the Cluster
<hostname_of_Grafana_host> = FullyqualifiedDomain Name of the node where Grafana has to be deleted.

