I am trying to submit an Oozie job using Java Client API from another Job's java action. The cluster is using Kerberos.
Here is my code:
// get a OozieClient for local Oozie
String oozieUrl = "http://hadooputl02.northamerica.xyz.net:11000/oozie/";
AuthOozieClient wc = new AuthOozieClient(oozieUrl);
wc.setDebugMode(1);
// create a workflow job configuration and set the workflow application path
Properties conf = wc.createConfiguration();
conf.setProperty(OozieClient.APP_PATH, wfAppPath);
conf.setProperty("jobTracker", "yarnRM");
conf.setProperty("nameNode", "hdfs://ingestiondev");
// submit and start the workflow job
String jobId = wc.run(conf);
System.out.println("Workflow job submitted");
But I am getting the following error:
org.apache.oozie.action.hadoop.JavaMainException: 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)
...
Caused by: AUTHENTICATION : Could not authenticate, GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt)
...
Caused by: org.apache.hadoop.security.authentication.client.AuthenticationException: GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt)
...
Caused by: GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt)
I believe there is something more required in the code to give the node/user access to the oozie server through kerberos.
Can someone point me to the correct way to use Oozie Java API on a Kerberized cluster?
thanks!