List and Execute Oozie jobs from the command line
Asked Answered
G

1

6

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).

Gambrinus answered 10/3, 2016 at 18:37 Comment(3)
What do you mean by "job": a Workflow, or a Coordinator? What do you mean by "deploy": did you run it, did you submit it?Alvardo
In the main page for Oozie documentation, there is an entry for "Command-line tool". And believe it or not, the CLI for Oozie is named oozie. oozie.apache.org/docs/4.2.0/DG_CommandLineTool.htmlAlvardo
You also have a half-decent monitoring console for recent Workflows executions (and running Coordinators) in Hue.Alvardo
S
11

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

Sibel answered 8/5, 2017 at 15:39 Comment(6)
i am following your answer but getting "Exception = Connection timed out" error.Zipporah
Are you on the correct oozie-url and port? and do you have access to it from the machine you are using?Sibel
actually i am using localhost only, but i am working in SSH secure shell , and other IP address. oozie job --oozie localhost:11000/oozie -config job.properties -runZipporah
You need to be sure oozie is running on the server and the correct port you are referring to(even if its your local machine, try giving the full qualified name)Sibel
thank you. now it is connected but now problem is like status is showing only RUNNING, it is not changing only. what might be the problem?Zipporah
I am not sure, you may create a new question with a bit more details, and then I or someone else can take a look.Sibel

© 2022 - 2024 — McMap. All rights reserved.