简体   繁体   中英

Kerberos Authentication Error - Sqoop import from SQL into HDFS via Hive

I am giving the following Sqoop command:

sqoop import \
    --connect "jdbc:sqlserver://ServerName:1433;databaseName=TESTDB;integratedSecurity=true" \
    --driver com.microsoft.sqlserver.jdbc.SQLServerDriver \
    --table dbo.test_table \
    --username hduser \
    -P \
    --hive-import \
    --create-hive-table \
    --hive-table test_table

and getting the following error:

com.microsoft.sqlserver.jdbc.SQLServerException: This driver is not configured for integrated authentication.

java.lang.UnsatisfiedLinkError: no sqljdbc_auth in java.library.path

EDIT

The solution for the above error was to add authenticationScheme=JavaKerberos to the connection string.

For Eg:

sqoop import \
    --connect "jdbc:sqlserver://server_name:1433;database=db_name;integratedSecurity=true;authenticationScheme=JavaKerberos" \
    --driver com.microsoft.sqlserver.jdbc.SQLServerDriver \
    --table Table_Name \
    --username username \
    -P \
    --target-dir /path/to/destination \
    --columns "col1, col2, col3" \
    --split-by col1 -m 4

Now I could list the databases and tables on the SQL server. All good till now.

But then, I am getting the Kerberos authentication error!!!

Caused by: java.security.PrivilegedActionException: GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt)

Get me a beer guys!!!

I think this is an firewall problem.

Reason:If you are using this Port number'1433' then you have to enable this port access in Windows Firewall.

Solution:

Just Turn Off the windows firewall while run this sqoop Job [OR] Enable the firewall rule for this port '1433'

Hope this really helpful for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM