Search code examples
hadoopapache-pigooziemapr

Invoke pig with oozie - org.apache.pig.Main exit code [2]


I am trying to invoke a Pig action in Oozie and I am working with the following-

  • Oozie v3.3.2
  • Pig v0.12.1-mapr
  • Hadoop v1.0.3
  • mapr M5

I am able to invoke a java action using Oozie as of now. However, when I try to invoke a Pig action, its failing with an error which isn't revealing much-

[Map/Reduce failed, error
 message[${wf:errorMessage(wf:lastErrorNode())}]], after resolve [Map/Reduce failed, error
 message[Main class [org.apache.oozie.action.hadoop.PigMain], exit code [2]]]

Looking at job logs I can infer only the following-

  • workflow has been parsed
  • oozie has invoked pig
  • job was being executed when it failed

How can I get Pig logs for this job? What is exit code [2]?


Solution

  • Turns out its pretty easy to get those Pig logs. It was staring me right in the face all the time.

    • Step 1 - Copy job ID for your currently running action in Oozie
    • Step 2 - Execute this mapred job -logs <jobid> #this will give you tracking URL for this job
    • Step 3 - Copy paste that URL to your browser
    • Step 4 - Dance round singing Eureka!