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.

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
New Member

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
New Member

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 Member

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