Unable to delete STORM REST API service component after hdp upgrade

Unable to delete STORM REST API service component after hdp upgrade to hdp2.2.0.0 ? Relax! You are at right place, this guide will show you how to handle these kind of errors.

 

upgrade

 

Initially I had installed hdp2.1 with ambari 1.7, then I upgraded ambari to 2.1.2 and upgraded hdp stack to 2.2.0.0 as per this documentation.

 

As per below note mentioned in the documentation, I had to delete STORM_UI_SERVER component:

 

“In HDP 2.2, STORM_REST_API component was deleted because the service was moved into STORM_UI_SERVER. When upgrading from HDP 2.1 to 2.2, you must delete this component using the API as follows”

 

I tried deleting it using Ambari REST APIs:

 

First stop the component using ambari API command:

curl -u admin:admin -X PUT -H 'X-Requested-By:1' -d '{"RequestInfo":{"context":"Stop Component"},"Body":{"HostRoles":{"state":"INSTALLED"}}}' http://hdpambari.hortonworks.com:8080/api/v1/clusters/c1/hosts/hdpambari.hortonworks.com/host_components/STORM_REST_API

 

Then Delete using below curl call.

curl -u admin:admin -X DELETE -H 'X-Requested-By:1' http://hdpambari.hortonworks.com:8080/api/v1/clusters/hdpambari/services/STORM/components/STORM_REST_API

 

Please note in above commands:

admin:admin - my username and password for ambari UI
hdpambari.hortonworks.com:8080 - my hostname where ambari-server is installed and port number of ambari server
hdpambari - my cluster name

 

Above commands did not work because of an error given below.

"message" : "org.apache.ambari.server.controller.spi.SystemException: An internal system exception occurred: Could not delete service component from cluster. To remove service component, it must be in DISABLED/INIT/INSTALLED/INSTALL_FAILED/UNKNOWN/UNINSTALLED/INSTALLING state

 

The only option was to remove this component completely from ambari database and restart ambari-server/agent processes.

 

Here is the short summary of what commands I ran:

[root@hdpambari ~]# psql ambari ambari
Password for user ambari:    #default password is "bigdata"
psql (8.4.20)
Type
"help" for help.
ambari=> delete from hostcomponentstate where component_name='STORM_REST_API';
DELETE 1
ambari=> delete from hostcomponentdesiredstate where component_name='STORM_REST_API';
DELETE 1
ambari=> delete from servicecomponentdesiredstate where component_name='STORM_REST_API';
DELETE 1
ambari=> commit;
WARNING: there is no transaction in progress
COMMIT
ambari=> \q
[root@hdpambari ~]#

 

This resolved my issue. hope this helps!

 

facebooktwittergoogle_plusredditpinterestlinkedinmailby feather

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>