We had setup an component/service which was no longer required by the customer hence decided to get rid of it. Checked the Ambari documentation did few trial error approach but did not help much.
Finally after spending much time I could fix it. Sharing the same RESTful command with community in order to save others’ time 🙂
curl -v -u admin:@dminPassword -H “X-Requested-By:ambari” -X DELETE “http://<Ambari_Host>/api/v1/clusters/<clustername>/ervices/<SerivceName >”
I recently learnt that it deletes the services only from the Ambari GUI but it does not delete from the database.
So you need to login to Ambari database. (Default is postgres) And execute the update table commands. For example : For Knox service I executed following DMLs.
psql ambari ambari
Password for user ambari: #default password is “bigdata”
delete from servicedesiredstate where service_name like ‘%KNOX%’;
delete from clusterservices where service_name like ‘KNOX’;
delete from hostcomponentstate where component_name like ‘%KNOX%’;
delete from hostcomponentdesiredstate where component_name like ‘%KNOX%’;
delete from servicecomponentdesiredstate where component_name like ‘%KNOX%’;
Note : If you are copy pasting the above command make sure you replace – and ” as they are encoded by the wordpress blog.