Support Questions

Find answers, ask questions, and share your expertise

The 'krb5-conf' configuration is not available

avatar
Explorer

when i install kerberos with ambari-server ,an error logs

 ERROR [ambari-client-thread-35] KerberosHelperImpl:1938 - The 'krb5-conf' configuration is not available
  ERROR [ambari-client-thread-35] AbstractResourceProvider:343 - Caught AmbariException when modifying a resource

i open source code of KerberosHelperImpl in ambari-server . here is the code

  Config configKrb5Conf = cluster.getDesiredConfigByType("krb5-conf");
    if (configKrb5Conf == null) {
      String message = "The 'krb5-conf' configuration is not available";
      LOG.error(message);
      throw new AmbariException(message);
    }

then i check krb-conf in ambair server host, two files

first

/etc/krb5.conf

second

/var/lib/ambari-server/resources/scripts/krb5.conf

which file ambari-server used , why the error occured

1 ACCEPTED SOLUTION

avatar
Master Mentor

@Elvis Zhang

Your issue looks similar to: https://issues.apache.org/jira/browse/AMBARI-16379

Can you please run the following SQL command on your ambari database to se eof the "selected=1" or not for the krb5-conf

sql>  select * from clusterconfig WHERE type_name in ('kerberos-env', 'krb5-conf'); 
sql>  select * from clusterconfigmapping WHERE type_name in ('kerberos-env', 'krb5-conf'); 
sql>  select ccm.type_name, ccm.version_tag, ccm.selected, cc.version_tag from clusterconfigmapping ccm left join clusterconfig cc on ccm.version_tag = cc.version_tag where ccm.selected = 1 and cc.version_tag is NULL;

.

You might need to run the following SQL queries in the ambari DB in order to see if it fixes your issue:

1. Find the latest version tag for "krb5-conf" using select query and then run the following command. Suppose if you found that the latest version tag for krb5-conf was "version1490320959000" (sothat you choose the latest version) in the DB then try setting it selected = 0 / 1 accordingly.

2. Restart ambari -server.

.

View solution in original post

5 REPLIES 5

avatar
Master Mentor

@Elvis Zhang

Your issue looks similar to: https://issues.apache.org/jira/browse/AMBARI-16379

Can you please run the following SQL command on your ambari database to se eof the "selected=1" or not for the krb5-conf

sql>  select * from clusterconfig WHERE type_name in ('kerberos-env', 'krb5-conf'); 
sql>  select * from clusterconfigmapping WHERE type_name in ('kerberos-env', 'krb5-conf'); 
sql>  select ccm.type_name, ccm.version_tag, ccm.selected, cc.version_tag from clusterconfigmapping ccm left join clusterconfig cc on ccm.version_tag = cc.version_tag where ccm.selected = 1 and cc.version_tag is NULL;

.

You might need to run the following SQL queries in the ambari DB in order to see if it fixes your issue:

1. Find the latest version tag for "krb5-conf" using select query and then run the following command. Suppose if you found that the latest version tag for krb5-conf was "version1490320959000" (sothat you choose the latest version) in the DB then try setting it selected = 0 / 1 accordingly.

2. Restart ambari -server.

.

avatar
Explorer

so many rows in tables, last version in 'clusterconfigmapping ' table

mysql>select * from clusterconfig WHERE type_name in ('kerberos-env', 'krb5-conf'); 

| 1059 | version1490153129291 | 41 | krb5-conf | 2 | 5 | {"domains":"","manage_krb5_conf":"false","conf_dir":"/etc","content":" ***** | 1490153128147 | 
*******
82 rows in set (0.02 sec)

mysql> select * from clusterconfigmapping WHERE type_name in ('kerberos-env', 'krb5-conf'); +--------------+------------------+------------+----------+----------------------+-----------+ 
| type_name | create_timestamp | cluster_id | selected | version_tag | user_name | +--------------+------------------+------------+----------+----------------------+-----------+ | krb5-conf | 1490153128175 | 2 | 0 | version1490153129291 | admin | +--------------+------------------+------------+----------+----------------------+-----------+

mysql> select ccm.type_name, ccm.version_tag, ccm.selected, cc.version_tag from clusterconfigmapping ccm left join clusterconfig cc on ccm.version_tag = cc.version_tag where ccm.selected = 1 and cc.version_tag is NULL; Empty set (0.00 sec)


should i change table 'clusterconfigmapping' ,the column 'selected=1' like this

update clusterconfigmapping set select=1 where version_tag='version1490153129291'and type_name='krb5-conf'

avatar
Master Mentor

@Elvis Zhang

The table output is so jumbled so i am not able to understand it clearly. But it is easy to take a table backup. like

sql> CREATE TABLE clusterconfigmapping_OLD as SELECT * FROM clusterconfigmapping;
sql> Select * from clusterconfigmapping_OLD;

.

If you see that te table back up is successful then try updating the table as per your previous command (make sure to commit the changes) and then restart ambari server to see how it goes. As you already have the table backup.

avatar
Explorer

thanks Jay very much! i works ;what's the reason of this error

avatar
New Contributor

I faced similar issue, but REST api thru -

 

http://localhost:8080/api/v1/cluster/[cluster_name]/services/KERBEROS 

was not available, and kerberos remove was giving error - "The 'krb5-conf' configuration is not available" in ambari-server.log

 

We had Ambari 2.7.5.0. In that version clusterconfigmapping is not present, we had to do below procedure:

 

In ambari db - 

psql -U ambari -d ambari
(default password: bigdata)


ambari=> select config_id, selected, create_timestamp from clusterconfig where type_name in ('kerberos-env', 'krb5-conf');
config_id | selected | create_timestamp
-----------+----------+------------------
352 | 0 | 1589796215822
452 | 0 | 1589800820822 << Select the record with latest timestamp
353 | 0 | 1589796215857
453 | 0 | 1589800820858 <<Select the record with latest timestamp
(4 rows)

ambari=> update clusterconfig set selected=1 where config_id=452;
UPDATE 1
ambari=> update clusterconfig set selected=1 where config_id=453;
UPDATE 1
ambari=>

update clusterconfig set selected=1 where config_id=452;
update clusterconfig set selected=1 where config_id=453;

 

* Still the kerberos REST api was not been shown.

* Remove the kerberos

* Add kerberos back