Support Questions
Find answers, ask questions, and share your expertise

Ambari Metrics Won't Install

Solved Go to solution

Re: Ambari Metrics Won't Install

@rgarcia@hortonworks.com Please see this

Also, I have added Jeff & Mahadev in this loop.

Re: Ambari Metrics Won't Install

Expert Contributor

Followed the recommended AH link from @Neeraj. See details below.

Logged in to postgresql:

ambari=> select * from hostcomponentstate where component_name LIKE '%RANGER%'; id  | cluster_id |  component_name   |   version  | current_stack_id | current_state  | host_id | service_name | upgrade_state | security_state-----+------------+-------------------+--------------+------------------+----------------+---------+--------------+---------------+---------------- 163 |  2 | RANGER_KMS_SERVER | 2.3.2.0-2950 |  4 | INSTALLED  |   5 | RANGER_KMS   | NONE  | UNKNOWN 164 |  2 | RANGER_USERSYNC   | UNKNOWN  |  4 | INSTALL_FAILED |   4 | RANGER   | NONE  | UNKNOWN 165 |  2 | RANGER_ADMIN  | UNKNOWN  |  4 | INSTALL_FAILED |   4 | RANGER   | NONE  | UNKNOWN(3 rows)ambari=> select * from hostcomponentdesiredstate where component_name LIKE '%RANGER%'; cluster_id | component_name | desired_stack_id | desired_state | host_id | service_name | admin_state | maintenance_state | security_state | restart_required------------+----------------+------------------+---------------+---------+--------------+-------------+-------------------+----------------+------------------(0 rows)ambari=> select * from servicecomponentdesiredstate where component_name LIKE '%RANGER%';  component_name   | cluster_id | desired_stack_id | desired_state | service_name-------------------+------------+------------------+---------------+-------------- RANGER_KMS_SERVER |  2 |  4 | INSTALLED   | RANGER_KMS RANGER_ADMIN  |  2 |  4 | INSTALLED   | RANGER RANGER_USERSYNC   |  2 |  4 | INSTALLED   | RANGER
(3 rows) 

Delete in tables:

ambari=> delete from hostcomponentstate where component_name LIKE '%RANGER%';DELETE 3ambari=> delete from servicecomponentdesiredstate where component_name LIKE '%RANGER%';
DELETE 3 

Then delete Services:

[root@great-wall02 ~]# curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE  http://great-wall01.cloud.hortonworks.com:8080/api/v1/clusters/smesecurity/services/RANGER
[root@great-wall02 ~]# curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE  http://great-wall01.cloud.hortonworks.com:8080/api/v1/clusters/smesecurity/services/RANGER_KMS

Deleted the databases for ranger: 'ranger', 'ranger_kms', 'ranger_audit'.

Tried reinstalling Ranger only but now getting the error below. Looks like there are some metadata in Ambari DB still that needs to be cleaned up. What ambari tables should I clean up?

05 Nov 2015 10:51:25,540 ERROR [qtp-client-26] ClusterImpl:2016 - Config inconsistency exists: unknown configType=ams-hbase-security-site
05 Nov 2015 10:51:25,541 ERROR [qtp-client-26] ClusterImpl:2016 - Config inconsistency exists: unknown configType=ams-hbase-site
05 Nov 2015 10:51:25,541 ERROR [qtp-client-26] ClusterImpl:2016 - Config inconsistency exists: unknown configType=ams-log4j
05 Nov 2015 10:51:25,542 ERROR [qtp-client-26] ClusterImpl:2016 - Config inconsistency exists: unknown configType=ams-site
05 Nov 2015 10:51:25,542 ERROR [qtp-client-26] ClusterImpl:2016 - Config inconsistency exists: unknown configType=ams-hbase-policy
05 Nov 2015 10:51:25,543 ERROR [qtp-client-26] ClusterImpl:2016 - Config inconsistency exists: unknown configType=ams-hbase-log4j
05 Nov 2015 10:51:25,543 ERROR [qtp-client-26] ClusterImpl:2016 - Config inconsistency exists: unknown configType=ams-env
05 Nov 2015 10:51:25,544 ERROR [qtp-client-26] ClusterImpl:2016 - Config inconsistency exists: unknown configType=ams-hbase-env
05 Nov 2015 10:51:25,544 ERROR [qtp-client-26] ClusterImpl:2016 - Config inconsistency exists: unknown configType=kms-properties
05 Nov 2015 10:51:25,545 ERROR [qtp-client-26] ClusterImpl:2016 - Config inconsistency exists: unknown configType=ranger-kms-policymgr-ssl
05 Nov 2015 10:51:25,545 ERROR [qtp-client-26] ClusterImpl:2016 - Config inconsistency exists: unknown configType=kms-log4j
05 Nov 2015 10:51:25,545 ERROR [qtp-client-26] ClusterImpl:2016 - Config inconsistency exists: unknown configType=ranger-kms-security
05 Nov 2015 10:51:25,546 ERROR [qtp-client-26] ClusterImpl:2016 - Config inconsistency exists: unknown configType=ranger-kms-audit
05 Nov 2015 10:51:25,546 ERROR [qtp-client-26] ClusterImpl:2016 - Config inconsistency exists: unknown configType=dbks-site
05 Nov 2015 10:51:25,546 ERROR [qtp-client-26] ClusterImpl:2016 - Config inconsistency exists: unknown configType=kms-env
05 Nov 2015 10:51:25,547 ERROR [qtp-client-26] ClusterImpl:2016 - Config inconsistency exists: unknown configType=kms-site
05 Nov 2015 10:51:25,547 ERROR [qtp-client-26] ClusterImpl:2016 - Config inconsistency exists: unknown configType=ranger-kms-site

Re: Ambari Metrics Won't Install

Re: Ambari Metrics Won't Install

Mentor

I recommend you select from each existing table in ambari, usually there are stale alerts, host configs also exist, you need to purge those as well. Don't just delete hostcomponentstate, hostcomponentdesiredstate, etc, go through all tables in ambari database and look for specific service. Sometimes you're lucky and only need to touch those desiredstate and componentstate tables but sometimes you need to clean up alerts, hostconfigs, etc.

Re: Ambari Metrics Won't Install

Just got off webex with @rgarcia@hortonworks.com

We were able to remove the failed Ranger/Metrics installation using something like the below:

su postgres
psql
\c ambari
DELETE FROM ambari.hostcomponentstate WHERE service_name IN ('RANGER');
DELETE FROM ambari.hostcomponentdesiredstate WHERE service_name IN ('RANGER');
DELETE FROM ambari.servicecomponentdesiredstate WHERE service_name IN ('RANGER');
DELETE FROM ambari.servicedesiredstate WHERE service_name IN ('RANGER');
DELETE FROM ambari.clusterservices WHERE service_name IN ('RANGER');

Then make sure to restart Ambari

service ambari-server restart

Now re-install Ranger/Ambair metrics

View solution in original post

Re: Ambari Metrics Won't Install

Re: Ambari Metrics Won't Install

@Ali Bajwa @rgarcia

I have accepted this as best answer to close the thread.

Re: Ambari Metrics Won't Install

Contributor

What is the solution to this problem? I also encounter it, able to delete and re-install, but fail with same error.

Re: Ambari Metrics Won't Install

@rxu There are couple of things to check..make sure repo files are correct.

Whats the error?

Re: Ambari Metrics Won't Install

Contributor

Same error. Repo checked, all looks good.