On 14.05.15 19:43, Artem Ervits wrote:
> Hello Eirik,
> I also struggled with this, eventually I figured it out by poking
around in the Ambari database. In essence, you need to make sure the
state is installed before you can delete it. Once you put it in the
correct state, you should be able to delete all components by first
listing which are still available. I apologize that I cannot give you
the steps I've taken but since it was a lot of trial and error, I don't
have a conclusive procedure.
Hello,
I've now checked that the state/desiredstate in the ambari-db is set to
INSTALLED for both component and service.
I'm able to delete all other Storm host-components, except
STORM_REST_API. For this I get:
curl -u admin:admin -X DELETE -H 'X-Requested-By: ambari'
http://localhost:8080/api/v1/clusters/helm/hosts/service-10-0.local/host_components/STORM_REST_API
{
"status" : 500,
"message" : "org.apache.ambari.server.controller.spi.SystemException:
An internal system exception occurred: Could not find service for
component, componentName=STORM_REST_API, clusterName=helm,
stackInfo=HDP-2.2"
The db shows that it is still there:
ambari=> select * from servicecomponentdesiredstate where service_name =
'STORM';
component_name | cluster_id | desired_stack_version
| desired_state | service_name
----------------+------------+------------------------------------------+---------------+--------------
STORM_REST_API | 2 | {"stackName":"HDP","stackVersion":"2.2"}
| INSTALLED | STORM
(1 row)
ambari=> SELECT * from hostcomponentstate where service_name = 'STORM';
cluster_id | component_name | current_stack_version
| current_state | host_name | service_name | upgrade_state |
version | s
ecurity_state
------------+----------------+------------------------------------------+---------------+--------------------+--------------+---------------+-----------+--
--------------
2 | STORM_REST_API | {"stackName":"HDP","stackVersion":"2.2"}
| INSTALLED | service-10-0.local | STORM | NONE |
2.2.4.2-2 | U
NSECURED
(1 row)
ambari=> SELECT * from hostcomponentdesiredstate where service_name =
'STORM';
cluster_id | component_name | desired_stack_version
| desired_state | host_name | service_name | admin_state |
maintenance_sta
te | restart_required | security_state
------------+----------------+------------------------------------------+---------------+--------------------+--------------+-------------+----------------
---+------------------+----------------
2 | STORM_REST_API | {"stackName":"HDP","stackVersion":"2.2"}
| INSTALLED | service-10-0.local | STORM | INSERVICE | OFF
| 0 | UNSECURED
(1 row)
ambari=> select * from servicedesiredstate where service_name = 'STORM';
cluster_id | desired_host_role_mapping |
desired_stack_version | desired_state | service_name |
maintenance_state | security_state
------------+---------------------------+------------------------------------------+---------------+--------------+-------------------+----------------
2 | 0 |
{"stackName":"HDP","stackVersion":"2.2"} | INSTALLED | STORM
| OFF | UNSECURED
(1 row)
ambari=> select * from clusterservices where service_name = 'STORM';
service_name | cluster_id | service_enabled
--------------+------------+-----------------
STORM | 2 | 0
(1 row)
This db info is not shown if I do a GET on the Storm service:
curl -u admin:admin -X DELETE -H 'X-Requested-By: ambari'
http://localhost:8080/api/v1/clusters/helm/services/STORM
{
"href" : "http://localhost:8080/api/v1/clusters/helm/services/STORM",
"ServiceInfo" : {
"cluster_name" : "helm",
"maintenance_state" : "OFF",
"service_name" : "STORM",
"state" : "UNKNOWN"
},
"alerts_summary" : {
"CRITICAL" : 1,
"MAINTENANCE" : 0,
"OK" : 0,
"UNKNOWN" : 0,
"WARNING" : 0
},
"alerts" : [
{
"href" :
"http://localhost:8080/api/v1/clusters/helm/services/STORM/alerts/8",
"Alert" : {
"cluster_name" : "helm",
"definition_id" : 24,
"definition_name" : "storm_supervisor_process_percent",
"host_name" : null,
"id" : 8,
"service_name" : "STORM"
}
}
],
"components" : [ ],
"artifacts" : [ ]
I also see much more Storm alerts in the alerts_definition table (though
they are all disabled, includung the one above).
Thanks,
Eirik Thorsnes