Reply
New Contributor
Posts: 1
Registered: ‎03-11-2019

Sqoop import jdbc:sqlserver connection with JavaKerberos failed

Hello, I am trying to connect to MSSQL with sqoop jdbc javakerberos option. The command below returns result successfully.

sqoop eval \
--connect "jdbc:sqlserver://FQDN:1433;databasename=dbName;integratedSecurity=true;authenticationScheme=JavaKerberos;"\
--query "select top 10 * FROM dbo.tableName"

On the other hand, I'm getting error with the below command.

sqoop import \
--connect "jdbc:sqlserver://FQDN:1433;databasename=databaseName;integratedSecurity=true;authenticationScheme=JavaKerberos;" \
--query "select top 10 * FROM dbo.tableName WHERE 1=1 AND \$CONDITIONS" \
--target-dir /user/root/sqoop \
-m 1 \
--delete-target-dir
  • Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Integrated authentication failed. ClientConnectionId:08e00b0d-a2f6-4e7a-b7c5-9a7881fd2c82
  • at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:2435)
  • at com.microsoft.sqlserver.jdbc.KerbAuthentication.intAuthInit(KerbAuthentication.java:135)
  • Caused by: java.security.PrivilegedActionException: GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt)
  • at java.security.AccessController.doPrivileged(Native Method)

 

To solve this issue, I created a new jaas.conf file in tmp directory.

SQLJDBCDriver {
com.sun.security.auth.module.Krb5LoginModule required
useTicketCache=false
useKeyTab=true
storeKey=true
keyTab="/etc/security/keytabs/hdfs.headless.keytab"
principal=hdfs-archieve@DN;
};

I tried to pass jaas.conf file to jdbc driver, but received another error : No LoginModules configured for /tmp/my_jaas.conf

sqoop import \
--connect "jdbc:sqlserver://FQDN:1433;databasename=databaseName;integratedSecurity=true;authenticationScheme=JavaKerberos;jaasConfigurationName=/tmp/my_jaas.conf" \
--query "select top 10 * FROM dbo.tableName WHERE 1=1 AND \$CONDITIONS" \
--target-dir /user/root/sqoop \
--delete-target-dir \
-m 1

 

Any help will be very much appreciated. Thanks in advance

Highlighted
Cloudera Employee
Posts: 37
Registered: ‎01-07-2019

Re: Sqoop import jdbc:sqlserver connection with JavaKerberos failed

It appears the same situation was discussed here: https://community.cloudera.com/t5/Cloudera-Manager-Installation/sqoop-import-GSS-initiate-failed-Fai...

In short, please try whether doing a kinit helps.

In case this was not the cause of the problem, this HCC thread discusses a more advanced approach: https://community.hortonworks.com/questions/20719/sqoop-to-sql-server-with-integrated-security.html
Announcements
New solutions