Support Questions
Find answers, ask questions, and share your expertise

How do you Remove a Service from HDP via Ambari

I no longer have a use for Accumulo on my cluster and would like to delete the service. But when I tried to do that in Ambari, I noticed I could only add a service, not remove one.

1 ACCEPTED SOLUTION

Accepted Solutions

Andrew, you need to use the Ambari API for doing so. You will need to first clear all the nodes which do have a component and then you will need to uninstall the service. The documentation on how to do it can be found on the ambari wiki.

https://cwiki.apache.org/confluence/display/AMBARI/Using+APIs+to+delete+a+service+or+all+host+compon...

Here is an example removing METRICS_COLLECTOR from a host.

curl -u admin -H "X-Requested-By: ambari" -X DELETE http://localhost:8080/api/v1/clusters/POCHDPPM01/hosts/hdmdup0002.machine.test.group/host_components...

View solution in original post

7 REPLIES 7

Guru

You can do this with the Ambari REST API like so

curl -u $USER:$PASS -i -H 'X-Requested-By: ambari' -X DELETE  http://$AMBARI_HOST:$AMBARI_PORT/api/v1/clusters/<cluster-name>/services/<service-name>;

Andrew, you need to use the Ambari API for doing so. You will need to first clear all the nodes which do have a component and then you will need to uninstall the service. The documentation on how to do it can be found on the ambari wiki.

https://cwiki.apache.org/confluence/display/AMBARI/Using+APIs+to+delete+a+service+or+all+host+compon...

Here is an example removing METRICS_COLLECTOR from a host.

curl -u admin -H "X-Requested-By: ambari" -X DELETE http://localhost:8080/api/v1/clusters/POCHDPPM01/hosts/hdmdup0002.machine.test.group/host_components...

View solution in original post

New Contributor

Unfortunately, does not seem to work with a failed install resulting in :

{ "status": 500, "message": "Server Error" }

Mentor

you probably have residual components that need to be removed as well or put service state in stopped state. @Rick Barthelmie

New Contributor

I removed the residual components using the technique here:

http://crazyadmins.com/tag/ambari-db-remove-service-components/

And then the service deleted OK.

Mentor

glad it worked!

New Contributor

Login to ambari database.

Remove the entry for service_name='Accumulo' from following five tables of ambari database in same sequence.

  • hostcomponentstate
  • hostcomponentdesiredstate
  • servicecomponentdesiredstate
  • servicedesiredstate
  • clusterservice