AnthonyC
AnthonyC

Reputation: 287

Oozie and sqoop configuration problems

I am trying to set up a oozie and sqoop workflow (I want to backup mySql data into my hdfs). But I am stuck when I try to start up my job.

I am using hadoop2(working hdfs node), the last version of oozie. I installed oozie server on my computer (I want to test it before deploying it) with the hdfs config (core-site.xml, hdfs-site.xml, yarn-site.xml, mapred-site.xml on the oozie conf/haddop-conf dir), and my hdfs on a server.

I have made a basic workflow (testing purpose, I just want to see if sqoop is working) like this:

<workflow-app name="Sqoop" xmlns="uri:oozie:workflow:0.4">
    <start to="Sqoop"/>
    <action name="Sqoop">
        <sqoop xmlns="uri:oozie:sqoop-action:0.2">
         <job-tracker>yarn.resourcemanager.address:8040</job-tracker>
          <name-node>hdfs://hdfs-server:54310</name-node>
          <command>job --list</command>
        </sqoop>
        <ok to="end"/>
        <error to="kill"/>
    </action>
    <kill name="kill">
        <message>Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
    </kill>
    <end name="end"/>
</workflow-app>

I put this workflow into my hdfs. I have made a java code for starting my job:

OozieClient wc = new OozieClient("http://localhost:11000/oozie");

        Properties conf = wc.createConfiguration();
        conf.setProperty( OozieClient.APP_PATH, "hdfs://hdfs_server:54310/hive/testSqoop/sqoop-workflow.xml" );
        conf.setProperty("queueName", "default");

        try {
            String jobId = wc.run(conf);
            System.out.println("Workflow job submitted");

            while (wc.getJobInfo(jobId).getStatus() == WorkflowJob.Status.RUNNING) {
                System.out.println("Workflow job running ...");
                System.out.println("..." + wc.getJobInfo(jobId).getStatus().toString() );
                Thread.sleep(10 * 1000);
            }
            System.out.println("Workflow job completed ...");
            System.out.println(wc.getJobInfo(jobId));
        } catch (Exception r) {
            r.printStackTrace();
        }

In Oozie webinterface I can see my job running

2013-05-28 12:42:30,004  INFO ActionStartXCommand:539 - USER[anthonyc] GROUP[-] TOKEN[] APP[Sqoop] JOB[0000000-130528124140043-oozie-anth-W] ACTION[0000000-130528124140043-oozie-anth-W@:start:] Start action [0000000-130528124140043-oozie-anth-W@:start:] with user-retry state : userRetryCount [0], userRetryMax [0], userRetryInterval [10]
2013-05-28 12:42:30,008  WARN ActionStartXCommand:542 - USER[anthonyc] GROUP[-] TOKEN[] APP[Sqoop] JOB[0000000-130528124140043-oozie-anth-W] ACTION[0000000-130528124140043-oozie-anth-W@:start:] [***0000000-130528124140043-oozie-anth-W@:start:***]Action status=DONE
2013-05-28 12:42:30,009  WARN ActionStartXCommand:542 - USER[anthonyc] GROUP[-] TOKEN[] APP[Sqoop] JOB[0000000-130528124140043-oozie-anth-W] ACTION[0000000-130528124140043-oozie-anth-W@:start:] [***0000000-130528124140043-oozie-anth-W@:start:***]Action updated in DB!
2013-05-28 12:42:30,192  INFO ActionStartXCommand:539 - USER[anthonyc] GROUP[-] TOKEN[] APP[Sqoop] JOB[0000000-130528124140043-oozie-anth-W] ACTION[0000000-130528124140043-oozie-anth-W@Sqoop] Start action [0000000-130528124140043-oozie-anth-W@Sqoop] with user-retry state : userRetryCount [0], userRetryMax [0], userRetryInterval [10]
2013-05-28 12:42:31,389  WARN SqoopActionExecutor:542 - USER[anthonyc] GROUP[-] TOKEN[] APP[Sqoop] JOB[0000000-130528124140043-oozie-anth-W] ACTION[0000000-130528124140043-oozie-anth-W@Sqoop] credentials is null for the action
2013-05-28 12:42:42,942  INFO SqoopActionExecutor:539 - USER[anthonyc] GROUP[-] TOKEN[] APP[Sqoop] JOB[0000000-130528124140043-oozie-anth-W] ACTION[0000000-130528124140043-oozie-anth-W@Sqoop] checking action, external ID [job_1369126414383_0003] status [RUNNING]
2013-05-28 12:42:42,945  WARN ActionStartXCommand:542 - USER[anthonyc] GROUP[-] TOKEN[] APP[Sqoop] JOB[0000000-130528124140043-oozie-anth-W] ACTION[0000000-130528124140043-oozie-anth-W@Sqoop] [***0000000-130528124140043-oozie-anth-W@Sqoop***]Action status=RUNNING
2013-05-28 12:42:42,946  WARN ActionStartXCommand:542 - USER[anthonyc] GROUP[-] TOKEN[] APP[Sqoop] JOB[0000000-130528124140043-oozie-anth-W] ACTION[0000000-130528124140043-oozie-anth-W@Sqoop] [***0000000-130528124140043-oozie-anth-W@Sqoop***]Action updated in DB!
2013-05-28 12:47:43,034  INFO KillXCommand:539 - USER[anthonyc] GROUP[-] TOKEN[] APP[Sqoop] JOB[0000000-130528124140043-oozie-anth-W] ACTION[-] STARTED WorkflowKillXCommand for jobId=0000000-130528124140043-oozie-anth-W
2013-05-28 12:47:43,328  WARN CoordActionUpdateXCommand:542 - USER[anthonyc] GROUP[-] TOKEN[] APP[Sqoop] JOB[0000000-130528124140043-oozie-anth-W] ACTION[-] E1100: Command precondition does not hold before execution, [, coord action is null], Error Code: E1100
2013-05-28 12:47:43,328  INFO KillXCommand:539 - USER[anthonyc] GROUP[-] TOKEN[] APP[Sqoop] JOB[0000000-130528124140043-oozie-anth-W] ACTION[-] ENDED WorkflowKillXCommand for jobId=0000000-130528124140043-oozie-anth-W

And when I check the yarn webinterface, I can see my job but with the status FAILED with

Application application_1369126414383_0003 failed 1 times due to AM Container for appattempt_1369126414383_0003_000001 exited with exitCode: 1 due to: .Failing this attempt.. Failing the application.

I really dont know what is wrong. I need your advice.

Thank you~

Upvotes: 1

Views: 1214

Answers (1)

ozw1z5rd
ozw1z5rd

Reputation: 3208

You have to inspect the job logs:

$ oozie job -log <coord_job_id> 

to understand what is happening.

Upvotes: 0

Related Questions