Support Questions

Find answers, ask questions, and share your expertise

Hive- Kerberos authentication issue with hive JDBC driver

avatar
Explorer

Hi, 

 

We got ODBC Connection working with Kerberos. However, JDBC has issues identifying the Kerberos Principal. 

The Connection string is: jdbc:hive2://{PUBLIC IP ADDRESS}:10000;AuthMech=1;KrbRealm={REALM};KrbHostFQDN={fqdn};KrbServiceName=impala;LogLevel=6;LogPath=/path/to/directory

 

we're getting the following error: 

[Cloudera][HiveJDBCDriver](500168) Error creating login context using ticket cache: Unable to obtain Principal Name for authentication.

 

Please help us resolving the issue.

 

Thanks in advance

1 REPLY 1

avatar
Explorer

Hi,

 

I followed the following approaches after that:

  1. Deleted the KRB5CCNAME environment variable containing the path to the KerberosTickets.txt.
  2. Set up the Kerberos configuration file( krb5.ini) and  entered the values as per the krb5.conf file in the dev cluster node.
  3. Set up the JAAS login configuration file with the following fields:

Client {

com.sun.security.auth.module.Krb5LoginModule required

useKeyTab=false

principal="user@COMPANY.COM"

doNotPrompt=true;

};

And set the environment variable java.security.auth.login.config to the location of the JAAS config file.

  • When I  tried connecting to hive in JAVA after making these changes, the connection was made successfully.
  • But when I  tried the same code in Rstudio, I  faced exception:
    • “Error in .jcall(drv@jdrv, "Ljava/sql/Connection;", "connect", as.character(url)[1],  : 

        java.sql.SQLException: [Cloudera][HiveJDBCDriver](500168) Error creating login context using ticket cache: Unable to obtain Principal Name for authentication .”

  • Also, I tried this code in R Console, but the following exception cropped up:

“java.sql.SQLException: [Cloudera][HiveJDBCDriver](500164) Error initialized or created transport for authentication: [Cloudera][HiveJDBCDriver](500169) Unable to connect to server: GSS initiate failed”

 

My understanding is that it is R is not able to get the environment variable path. correct me if i'm wrong.

I've seen many links in google but that didn't work.

 

I'm using 

Rconsole :3.4.1 and 

RStudio : version 1.1.353

 

Please suggest us how do we proceed further.

 

Thanks