Expert Contributor
Posts: 76
Registered: ‎11-24-2017

Sqoop with --hive-import on Kerberos based cluster

Hello everyone!


I have a Kerberos based cluster where I need to schedule several Oozie workflows. 

Normal sqoop and shell actions work fine, but I am having problems with sqoop actions that import data in hive tables (--hive-import). I've tried to use hcat credentials in the workflow but I got the following error in Oozie web console:


JA009: org.apache.hive.hcatalog.common.HCatException : 9001 : Exception occurred while processing HCat request : TException while getting delegation token.. Cause : org.apache.thrift.transport.TTransportException

This is the workflow:


<workflow-app xmlns="uri:oozie:workflow:0.5" name="wf-hive">

        <credential name='hcat_credentials' type='hcat'>

    <start to="HIVE_IMPORT"/>
    <action name="HIVE_IMPORT" cred="hcat_credentials">
                <delete path="hdfs://trmas-6b8bc78c.xxxxx.yyyy:8020/user/myuser/mytable"/>
            <arg>SELECT * from mytable WHERE $CONDITIONS</arg>
        <ok to="END_NODE"/>
        <error to="KILL_NODE"/>

    <kill name="KILL_NODE">

    <end name="END_NODE"/>



I am not sure how to valorize hcat.metastore.uri and hcat.metastore.principal properties...I have used the values of respectfully hive.metastore.uris and hive.metastore.kerberos.principal from the hive-site.xml, is this correct?


Unfortunately I can't use Sqoop2 and its support for HiveServer2 authentication because the Cloudera Teradata connector does not support Sqoop2 yet, thus I think I should authenticate with the HCat credentials.


Please anyone can provide any help on this one? 


Cloudera Employee
Posts: 815
Registered: ‎03-23-2015

Re: Sqoop with --hive-import on Kerberos based cluster

You said that you got the error from Oozie web console, have you checked the actual launcher job that failed with exact error message? I am not sure the error you posted is actually related to the job you ran.

When Oozie runs a workflow, it starts a launcher job, which itself is a MR job, and the launcher job is responsible for starting the actual actions, in your case is Sqoop1 action. While running the Sqoop action in the launcher, launcher will capture the outputs of Sqoop job into its mapper's stdout, so you need to find the launcher from JobHistory server web UI and locate the full logs to see the exact error of the failed job. Hope that makes sense. Once find it, please share the error message.

Regarding Sqoop2, it is deprecated since CDH5.9 and will be removed in CDH6, so you should not go with that option regardless.