Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Oozie Java API - Kerberos Auth

Highlighted

Oozie Java API - Kerberos Auth

Rising Star

I am attempting to use the Oozie Java API's AuthOozieClient class to run a workflow.  The cluster I'm using is Kerberos-enabled and I must authenticate before getting a valid connection.  I can't seem to figure out how to authenticate with Kerberos and I get the following error:

IO_ERROR : java.io.IOException: Error while connecting Oozie server. No of retries = 1. Exception = Could not authenticate, GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt)
Errors

 

I know I have connectivity to the cluster, and I do have an active keytab on the cluster.

 

Here is a code snippet of what I have:

private static String oozieUrlString = "https://OMITTED:11443/oozie/v1/jobs?action=start";	
private static String appPath = "hdfs://OMITTED/";
    public static void main( String[] args ) throws LoginException
    {
    	AuthOozieClient wc = new AuthOozieClient(oozieUrlString, AuthOozieClient.AuthType.KERBEROS.name());
    	//AuthOozieClient wc = new AuthOozieClient(oozieUrl);

        Properties conf = wc.createConfiguration();
        //conf.setProperty code OMITTED
        
        
        try {
            String jobId = wc.run(conf);
        } catch (Exception r) {
        	System.out.println(r);
            System.out.println("Errors");
        }

        
    }

 

 

Any help is appreciated

1 REPLY 1

Re: Oozie Java API - Kerberos Auth

Super Collaborator

Hi,

 

I don't have the exact answer for you. But in your shoe, I would begin by providing a valid jaas configuration to the JVM connecting to Oozie using the java API.

 

The jaas configuration should either make use of the keytab available (or a ticket cache).

 

regards,

mathieu

Don't have an account?
Coming from Hortonworks? Activate your account here