Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

How do you Remove a Service from HDP via Ambari

avatar

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

avatar

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

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

avatar

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

avatar
Explorer

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

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

avatar
Master Mentor

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

avatar
Explorer

I removed the residual components using the technique here:

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

And then the service deleted OK.

avatar
Master Mentor

glad it worked!

avatar
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