@Mukesh Kumar
- Login to your Ambari DB. For example postgres then:
# psql -U ambari ambari
Password for user ambari: bigdata
- Then run the following queries to completely remove the Zookeeper service from DB.
delete from hostcomponentstate where service_name = 'ZOOKEEPER';
delete from hostcomponentdesiredstate where service_name = 'ZOOKEEPER';
delete from servicecomponentdesiredstate where service_name = 'ZOOKEEPER';
delete from servicedesiredstate where service_name = 'ZOOKEEPER';
delete from alert_current where history_id in (select alert_id from alert_history where service_name = 'ZOOKEEPER');
delete from alert_notice where history_id in (select alert_id from alert_history where service_name = 'ZOOKEEPER');
delete from alert_history where service_name = 'ZOOKEEPER';
delete from alert_grouping where definition_id in (select definition_id from alert_definition where service_name = 'ZOOKEEPER');
delete from alert_history where alert_definition_id in (select definition_id from alert_definition where service_name = 'ZOOKEEPER');
delete from alert_current where definition_id in (select definition_id from alert_definition where service_name = 'ZOOKEEPER');
delete from alert_definition where service_name = 'ZOOKEEPER';
delete from alert_group_target where group_id in ( select group_id from alert_group where service_name = 'ZOOKEEPER');
delete from alert_group where service_name = 'ZOOKEEPER';
delete from serviceconfighosts where service_config_id in (select service_config_id from serviceconfig where service_name = 'ZOOKEEPER');
delete from serviceconfigmapping where service_config_id in (select service_config_id from serviceconfig where service_name = 'ZOOKEEPER');
delete from serviceconfig where service_name = 'ZOOKEEPER';
delete from requestresourcefilter where service_name = 'ZOOKEEPER';
delete from requestoperationlevel where service_name = 'ZOOKEEPER';
delete from clusterservices where service_name ='ZOOKEEPER';
delete from clusterconfig where type_name like 'zookeeper%';
delete from clusterconfigmapping where type_name like 'zookeeper%';
- Now restart ambari server:
# ambari-server restart
.
Additionally the 500 error for the API call "POST method for API: /api/v1/stacks/HDP/versions/2.5/recommendations." indicates a DB inconsistency. So if it is a fresh cluster then or if you do not want to have any service installed to is and move to the very initial state of ambari installation then better to perform an ambari reset instead of deleting services from ambari UI (As we see you only have zookeeper installed there)
# ambari-server reset
.
*NOTE:* It is always recommended to keep a DB dump as a backup before making any manual DB changes.