List and Execute Oozie jobs from the command line

Knows Not Much picture Knows Not Much · Mar 10, 2016 · Viewed 14.8k times · Source

I just deployed a oozie job. Now when I go to the oozie web ui ... i just cannot see the job I deployed.

Is there a command line tool which will allow me to do two things

  1. List all the jobs which are deployed (not running, active, killed)... but deployed. like an inventory of all jobs.

  2. execute a job from the command line. (on demand, not based on schedule).

Answer

Biplob Biswas picture Biplob Biswas · May 8, 2017

As already mentioned in one of the comments that ooziein itself is a command line tool.

Therefore, to answer both of your questions:

  1. List all jobs
    • For listing all workflow jobs use the following command
      1. oozie jobs
      2. oozie jobs -jobtype wf
    • For listing all coordinator jobs use the following command from the console
      1. oozie jobs -jobtype coordinator
  2. Execute a job from command line
    • oozie job --oozie http://oozie-url:11000/oozie -config job.properties -run

Mind you that if you want to keep on starting on demand job either you have to run the above command manually (also only for workflow jobs, not for coordinator jobs as coordinator jobs would be scheduled according to the schedule you define) or put in a shell script so that it is triggered under certain situations

For more info check this link - Oozie_Command_Line_Usage