Full authentication is required to access this resource while deleting a service/component from Ambari

Hi,

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.

Tried many permutation combinations, referred to Ambari Documentation to delete the service, referred to Stack-overflow but finally stuck up with

HTTP ERROR: 403

Problem accessing /api/v1/hostname.

Reason: Full authentication is required to access this resource

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.

Advertisements

Tagged: ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: