Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Community Articles

Find and share helpful community-sourced technical articles.
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!
Labels (1)
avatar
Super Guru

1. Lets assume you have HDP cluster installed and managed by Ambari.

2. When we want to delete a service [either Custom service or HDP service] using api, you generally use below command -

curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://<ambari-server>:8080/api/v1/clusters/c1/services/<SERVICENAME>;

2. After executing above command you might see below error -

$curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://<ambari-server>:8080/api/v1/clusters/c1/services/HBASE

{ "status" : 500, "message" : "org.apache.ambari.server.controller.spi.SystemException: An internal system exception occurred: Cannot remove HBASE. Desired state STARTED is not removable. Service must be stopped or disabled." 

3. If you see the above error while Removing/Stopping service please use below steps to resolve the issue

4. Login to ambari database [In my case its postgresql] and check the values of the service in below tables -

# psql -U ambari
[Default password is 'bigdata']

ambari=> select * from servicedesiredstate where service_name='HBASE';
ambari=> select * from servicecomponentdesiredstate where service_name='HBASE';

5. Make sure here in above output the value of column 'desired_state' should be INSTALLED

6. If you see the above value of "desired_state" is set to STARTED then update the column and set it to STARTED using below command -

ambari=> update servicedesiredstate set desired_state='INSTALLED' where service_name='HBASE';

7. Follow same steps for "servicecomponentdesiredstate" table -

ambari=> update servicecomponentdesiredstate set desired_state='INSTALLED' where service_name='HBASE';

8. Now try removing/deleting the service now. It should work.

$curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://<ambari-server>:8080/api/v1/clusters/c1/services/HBASE
1,123 Views
Version history
Last update:
‎11-08-2016 07:08 PM
Updated by:
Contributors