http://git-wip-us.apache.org/repos/asf/oozie/blob/4e5b3cb5/docs/src/site/twiki/DG_CommandLineTool.twiki ---------------------------------------------------------------------- diff --git a/docs/src/site/twiki/DG_CommandLineTool.twiki b/docs/src/site/twiki/DG_CommandLineTool.twiki index 8d33c50..51382c7 100644 --- a/docs/src/site/twiki/DG_CommandLineTool.twiki +++ b/docs/src/site/twiki/DG_CommandLineTool.twiki @@ -1,39 +1,42 @@ -<noautolink> -[[index][::Go back to Oozie Documentation Index::]] ----+!! Command Line Interface Utilities +[::Go back to Oozie Documentation Index::](index.html) -%TOC% +# Command Line Interface Utilities ----++ Introduction +<!-- MACRO{toc|fromDepth=1|toDepth=4} --> -Oozie provides a command line utility, =oozie=, to perform job and admin tasks. All operations are done via -sub-commands of the =oozie= CLI. +## Introduction -The =oozie= CLI interacts with Oozie via its WS API. +Oozie provides a command line utility, `oozie`, to perform job and admin tasks. All operations are done via +sub-commands of the `oozie` CLI. ----++ Oozie Command Line Usage +The `oozie` CLI interacts with Oozie via its WS API. -<verbatim> +## Oozie Command Line Usage + + +``` usage: the env variable 'OOZIE_URL' is used as default value for the '-oozie' option the env variable 'OOZIE_TIMEZONE' is used as default value for the '-timezone' option the env variable 'OOZIE_AUTH' is used as default value for the '-auth' option custom headers for Oozie web services can be specified using '-Dheader:NAME=VALUE' -</verbatim> +``` ----+++ Oozie basic commands -<verbatim> +### Oozie basic commands + +``` oozie help : display usage oozie version : show client version -</verbatim> +``` + +### Oozie job operation commands ----+++ Oozie job operation commands -<verbatim> +``` oozie job <OPTIONS> : job operations -action <arg> coordinator rerun/kill on action ids (requires -rerun/-kill); @@ -117,10 +120,11 @@ oozie job <OPTIONS> : job operations prefix defined in =oozie-site.xml#oozie.client.jobs.application.generated.path= is used. Output is the workflow ID -</verbatim> +``` ----+++ Oozie jobs operation commands -<verbatim> +### Oozie jobs operation commands + +``` oozie jobs <OPTIONS> : jobs status -auth <arg> select authentication type [SIMPLE|KERBEROS] -doas <arg> doAs user, impersonates as the specified user. @@ -142,10 +146,11 @@ oozie jobs <OPTIONS> : jobs status other options, it will resume all the first 50 workflow jobs. Command will fail if one or more of the jobs is in wrong state. -verbose verbose mode -</verbatim> +``` + +### Oozie admin operation commands ----+++ Oozie admin operation commands -<verbatim> +``` oozie admin <OPTIONS> : admin operations -auth <arg> select authentication type [SIMPLE|KERBEROS] -configuration show Oozie system configuration @@ -165,27 +170,30 @@ oozie admin <OPTIONS> : admin operations -version show Oozie server build version -purge <arg> purge old oozie workflow, coordinator and bundle records from DB (parameter unit: day) wf=<N>\;coord=<N>\;bundle=<N>\;limit=<N>\;oldcoordaction=<true/false> -</verbatim> +``` + +### Oozie validate command ----+++ Oozie validate command -<verbatim> +``` oozie validate <OPTIONS> <ARGS> : validate a workflow, coordinator, bundle XML file -auth <arg> select authentication type [SIMPLE|KERBEROS] -oozie <arg> Oozie URL -</verbatim> +``` ----+++ Oozie SLA operation commands -<verbatim> +### Oozie SLA operation commands + +``` oozie sla <OPTIONS> : sla operations (Deprecated as of Oozie 4.0) -auth <arg> select authentication type [SIMPLE|KERBEROS] -len <arg> number of results (default '100', max limited by oozie server setting which defaults to '1000') -offset <arg> start offset (default '0') -oozie <arg> Oozie URL -filter <arg> jobid=<JobID/ActionID>\;appname=<Application Name> -</verbatim> +``` + +### Oozie Pig submit command ----+++ Oozie Pig submit command -<verbatim> +``` oozie pig <OPTIONS> -X <ARGS> : submit a pig job, everything after '-X' are pass-through parameters to pig, any '-D' arguments after '-X' are put in <configuration> -auth <arg> select authentication type [SIMPLE|KERBEROS] @@ -195,10 +203,11 @@ oozie pig <OPTIONS> -X <ARGS> : submit a pig job, everything after '-X' are pass -file <arg> Pig script -oozie <arg> Oozie URL -P <property=value> set parameters for script -</verbatim> +``` + +### Oozie Hive submit command ----+++ Oozie Hive submit command -<verbatim> +``` oozie hive <OPTIONS> -X<ARGS> : submit a hive job, everything after '-X' are pass-through parameters to hive, any '-D' arguments after '-X' are put in <configuration> -auth <arg> select authentication type [SIMPLE|KERBEROS] @@ -208,10 +217,11 @@ oozie hive <OPTIONS> -X<ARGS> : submit a hive job, everything after '-X' are pa -file <arg> hive script -oozie <arg> Oozie URL -P <property=value> set parameters for script -</verbatim> +``` ----+++ Oozie Sqoop submit command -<verbatim> +### Oozie Sqoop submit command + +``` oozie sqoop <OPTIONS> -X<ARGS> : submit a sqoop job, any '-D' arguments after '-X' are put in <configuration> -auth <arg> select authentication type [SIMPLE|KERBEROS] -config <arg> job configuration file '.properties' @@ -219,246 +229,259 @@ oozie sqoop <OPTIONS> -X<ARGS> : submit a sqoop job, any '-D' arguments after '- -doas <arg> doAs user, impersonates as the specified user -command <arg> sqoop command -oozie <arg> Oozie URL -</verbatim> +``` + +### Oozie info command ----+++ Oozie info command -<verbatim> +``` oozie info <OPTIONS> : get more detailed info about specific topics -timezones display a list of available time zones -</verbatim> +``` + +### Oozie MapReduce job command ----+++ Oozie MapReduce job command -<verbatim> +``` oozie mapreduce <OPTIONS> : submit a mapreduce job -auth <arg> select authentication type [SIMPLE|KERBEROS] -config <arg> job configuration file '.properties' -D <property=value> set/override value for given property -doas <arg> doAs user, impersonates as the specified user -oozie <arg> Oozie URL -</verbatim> +``` ----++ Common CLI Options +## Common CLI Options ----+++ Authentication +### Authentication -The =oozie= CLI automatically perform authentication if the Oozie server requests it. By default it supports both +The `oozie` CLI automatically perform authentication if the Oozie server requests it. By default it supports both pseudo/simple authentication and Kerberos HTTP SPNEGO authentication. -To perform a specific authentication, the =auth= option with authentication type requests Oozie client to run the -specified authentication mechanism only. Oozie client provides two types =simple= and =kerberos= which supports =pseudo/simple= and =Kerberos=. +To perform a specific authentication, the `auth` option with authentication type requests Oozie client to run the +specified authentication mechanism only. Oozie client provides two types `simple` and `kerberos` which supports `pseudo/simple` and `Kerberos`. -For pseudo/simple authentication the =oozie= CLI uses the user name of the current OS user. +For pseudo/simple authentication the `oozie` CLI uses the user name of the current OS user. -For Kerberos HTTP SPNEGO authentication the =oozie= CLI uses the default principal for the OS Kerberos cache -(normally the principal that did =kinit=). +For Kerberos HTTP SPNEGO authentication the `oozie` CLI uses the default principal for the OS Kerberos cache +(normally the principal that did `kinit`). Oozie uses Apache Hadoop-Auth (Java HTTP SPNEGO) library for authentication. This library can be extended to support other authentication mechanisms. Once authentication is performed successfully the received authentication token is cached in the user home directory -in the =.oozie-auth-token= file with owner-only permissions. Subsequent requests reuse the cached token while valid. +in the `.oozie-auth-token` file with owner-only permissions. Subsequent requests reuse the cached token while valid. -The use of the cache file can be disabled by invoking the =oozie= CLI with the =-Doozie.auth.token.cache=false= +The use of the cache file can be disabled by invoking the `oozie` CLI with the `-Doozie.auth.token.cache`false= option. -To use an custom authentication mechanism, a Hadoop-Auth =Authenticator= implementation must be specified with the - =-Dauthenticator.class= = =CLASS= option. +To use an custom authentication mechanism, a Hadoop-Auth `Authenticator` implementation must be specified with the + `-Dauthenticator.class=CLASS` option. ----+++ Impersonation, doAs +### Impersonation, doAs -The <code>-doas</code> option allows the current user to impersonate other users when interacting with the Oozie +The `-doas` option allows the current user to impersonate other users when interacting with the Oozie system. The current user must be configured as a proxyuser in the Oozie system. The proxyuser configuration may restrict from which hosts a user may impersonate users, as well as users of which groups can be impersonated. ----+++ Oozie URL +### Oozie URL -All =oozie= CLI sub-commands expect the <code>-oozie OOZIE_URL</code> option indicating the URL of the Oozie system -to run the command against. If the OOZIE_URL environment variable has not been set, =oozie= will use the default -URL specified in oozie-client-env.sh (equivalent to =!http://$(hostname -f):11000/oozie=). +All `oozie` CLI sub-commands expect the `-oozie OOZIE_URL` option indicating the URL of the Oozie system +to run the command against. If the OOZIE_URL environment variable has not been set, `oozie` will use the default +URL specified in oozie-client-env.sh (equivalent to `!http://$(hostname -f):11000/oozie`). -If the <code>-oozie</code> option is not specified, the =oozie= CLI will look for the =OOZIE_URL= environment variable +If the `-oozie` option is not specified, the `oozie` CLI will look for the `OOZIE_URL` environment variable and uses it if set. -If the option is not provided and the environment variable is not set, the =oozie= CLI will fail. +If the option is not provided and the environment variable is not set, the `oozie` CLI will fail. ----+++ Time zone +### Time zone -The <code>-timezone TIME_ZONE_ID</code> option in the =job= and =jobs= sub-commands allows you to specify the time zone to use in -the output of those sub-commands. The <code>TIME_ZONE_ID</code> should be one of the standard Java Time Zone IDs. You can get a -list of the available time zones with the command =oozie info -timezones=. +The `-timezone TIME_ZONE_ID` option in the `job` and `jobs` sub-commands allows you to specify the time zone to use in +the output of those sub-commands. The `TIME_ZONE_ID` should be one of the standard Java Time Zone IDs. You can get a +list of the available time zones with the command `oozie info -timezones`. -If the <code>-localtime</code> option is used, it will cause Oozie to use whatever the time zone is of the machine. If -both <code>-localtime</code> and <code>-timezone TIME_ZONE_ID</code> are used, the <code>-localtime</code> option will override -the <code>-timezone TIME_ZONE_ID</code> option. If neither option is given, Oozie will look for the =OOZIE_TIMEZONE= environment +If the `-localtime` option is used, it will cause Oozie to use whatever the time zone is of the machine. If +both `-localtime` and `-timezone TIME_ZONE_ID` are used, the `-localtime` option will override +the `-timezone TIME_ZONE_ID` option. If neither option is given, Oozie will look for the `OOZIE_TIMEZONE` environment variable and uses it if set. If neither option is given and the environment variable is not set, or if Oozie is given an invalid time zone, it will use GMT. ----+++ Debug Mode +### Debug Mode -If you export <code>OOZIE_DEBUG=1</code> then the Oozie CLI will output the Web Services API details used by any commands you +If you export `OOZIE_DEBUG=1` then the Oozie CLI will output the Web Services API details used by any commands you execute. This is useful for debugging purposes to or see how the Oozie CLI works with the WS API. ----+++ CLI retry +### CLI retry Oozie CLI retries connection to Oozie servers for transparent high availability failover when one of the Oozie servers go down. -=Oozie= CLI command will retry for all commands in case of ConnectException. -In case of SocketException, all commands except =PUT= and =POST= will have retry logic. -All job submit are POST call, examples of PUT and POST commands can be find out from [[WebServicesAPI][WebServicesAPI]]. -Retry count can be configured with system property =oozie.connection.retry.count=. Default count is 4. +`Oozie` CLI command will retry for all commands in case of ConnectException. +In case of SocketException, all commands except `PUT` and `POST` will have retry logic. +All job submit are POST call, examples of PUT and POST commands can be find out from [WebServicesAPI](WebServicesAPI.html). +Retry count can be configured with system property `oozie.connection.retry.count`. Default count is 4. ----++ Job Operations +## Job Operations ----+++ Submitting a Workflow, Coordinator or Bundle Job +### Submitting a Workflow, Coordinator or Bundle Job * Submitting bundle feature is only supported in Oozie 3.0 or later. Similarly, all bundle operation features below are only supported in Oozie 3.0 or later. Example: -<verbatim> + +``` $ oozie job -oozie http://localhost:11000/oozie -config job.properties -submit . job: 14-20090525161321-oozie-joe -</verbatim> +``` The parameters for the job must be provided in a file, either a Java Properties file (.properties) or a Hadoop XML -Configuration file (.xml). This file must be specified with the <code>-config</code> option. +Configuration file (.xml). This file must be specified with the `-config` option. -The workflow application path must be specified in the file with the =oozie.wf.application.path= property. The -coordinator application path must be specified in the file with the =oozie.coord.application.path= property.The -bundle application path must be specified in the file with the =oozie.bundle.application.path= property. +The workflow application path must be specified in the file with the `oozie.wf.application.path` property. The +coordinator application path must be specified in the file with the `oozie.coord.application.path` property.The +bundle application path must be specified in the file with the `oozie.bundle.application.path` property. Specified path must be an HDFS path. -The job will be created, but it will not be started, it will be in =PREP= status. +The job will be created, but it will not be started, it will be in `PREP` status. ----+++ Starting a Workflow, Coordinator or Bundle Job +### Starting a Workflow, Coordinator or Bundle Job Example: -<verbatim> + +``` $ oozie job -oozie http://localhost:11000/oozie -start 14-20090525161321-oozie-joe -</verbatim> +``` -The =start= option starts a previously submitted workflow job or bundle job that is in =PREP= status. +The `start` option starts a previously submitted workflow job or bundle job that is in `PREP` status. -After the command is executed the workflow job will be in =RUNNING= status and bundle job will be in =RUNNING=status. +After the command is executed the workflow job will be in `RUNNING` status and bundle job will be in `RUNNING`status. -A coordinator job does not support the =start= action. It will show the following error message when trying to start it +A coordinator job does not support the `start` action. It will show the following error message when trying to start it via the CLI: -<verbatim> + +``` Error: E0303 : E0303: Invalid parameter value, [action] = [start] -</verbatim> +``` ----+++ Running a Workflow, Coordinator or Bundle Job +### Running a Workflow, Coordinator or Bundle Job Example: -<verbatim> + +``` $ oozie job -oozie http://localhost:11000/oozie -config job.properties -run . job: 15-20090525161321-oozie-joe -</verbatim> +``` -The =run= option creates and starts a workflow job, coordinator job or bundle job. +The `run` option creates and starts a workflow job, coordinator job or bundle job. The parameters for the job must be provided in a file, either a Java Properties file (.properties) or a Hadoop XML -Configuration file (.xml). This file must be specified with the <code>-config</code> option. +Configuration file (.xml). This file must be specified with the `-config` option. -The workflow application path must be specified in the file with the =oozie.wf.application.path= property. The -coordinator application path must be specified in the file with the =oozie.coord.application.path= property. The -bundle application path must be specified in the file with the =oozie.bundle.application.path= property.The +The workflow application path must be specified in the file with the `oozie.wf.application.path` property. The +coordinator application path must be specified in the file with the `oozie.coord.application.path` property. The +bundle application path must be specified in the file with the `oozie.bundle.application.path` property.The specified path must be an HDFS path. -The job will be created and it will started, the job will be in =RUNNING= status. +The job will be created and it will started, the job will be in `RUNNING` status. ----+++ Suspending a Workflow, Coordinator or Bundle Job +### Suspending a Workflow, Coordinator or Bundle Job Example: -<verbatim> + +``` $ oozie job -oozie http://localhost:11000/oozie -suspend 14-20090525161321-oozie-joe -</verbatim> +``` -The =suspend= option suspends a workflow job in =RUNNING= status. -After the command is executed the workflow job will be in =SUSPENDED= status. +The `suspend` option suspends a workflow job in `RUNNING` status. +After the command is executed the workflow job will be in `SUSPENDED` status. -The =suspend= option suspends a coordinator/bundle job in =RUNNING=, =RUNNINGWITHERROR= or =PREP= status. -When the coordinator job is suspended, running coordinator actions will stay in running and the workflows will be suspended. If the coordinator job is in =RUNNING=status, it will transit to =SUSPENDED=status; if it is in =RUNNINGWITHERROR=status, it will transit to =SUSPENDEDWITHERROR=; if it is in =PREP=status, it will transit to =PREPSUSPENDED=status. +The `suspend` option suspends a coordinator/bundle job in `RUNNING`, `RUNNINGWITHERROR` or `PREP` status. +When the coordinator job is suspended, running coordinator actions will stay in running and the workflows will be suspended. If the coordinator job is in `RUNNING`status, it will transit to `SUSPENDED`status; if it is in `RUNNINGWITHERROR`status, it will transit to `SUSPENDEDWITHERROR`; if it is in `PREP`status, it will transit to `PREPSUSPENDED`status. -When the bundle job is suspended, running coordinators will be suspended. If the bundle job is in =RUNNING=status, it will transit to =SUSPENDED=status; if it is in =RUNNINGWITHERROR=status, it will transit to =SUSPENDEDWITHERROR=; if it is in =PREP=status, it will transit to =PREPSUSPENDED=status. +When the bundle job is suspended, running coordinators will be suspended. If the bundle job is in `RUNNING`status, it will transit to `SUSPENDED`status; if it is in `RUNNINGWITHERROR`status, it will transit to `SUSPENDEDWITHERROR`; if it is in `PREP`status, it will transit to `PREPSUSPENDED`status. ----+++ Resuming a Workflow, Coordinator or Bundle Job +### Resuming a Workflow, Coordinator or Bundle Job Example: -<verbatim> + +``` $ oozie job -oozie http://localhost:11000/oozie -resume 14-20090525161321-oozie-joe -</verbatim> +``` -The =resume= option resumes a workflow job in =SUSPENDED= status. +The `resume` option resumes a workflow job in `SUSPENDED` status. -After the command is executed the workflow job will be in =RUNNING= status. +After the command is executed the workflow job will be in `RUNNING` status. -The =suspend= option suspends a coordinator/bundle job in =SUSPENDED=, =SUSPENDEDWITHERROR= or =PREPSUSPENDED= status. -If the coordinator job is in =SUSPENDED=status, it will transit to =RUNNING=status; if it is in =SUSPENDEDWITHERROR=status, it will transit to =RUNNINGWITHERROR=; if it is in =PREPSUSPENDED=status, it will transit to =PREP=status. +The `suspend` option suspends a coordinator/bundle job in `SUSPENDED`, `SUSPENDEDWITHERROR` or `PREPSUSPENDED` status. +If the coordinator job is in `SUSPENDED`status, it will transit to `RUNNING`status; if it is in `SUSPENDEDWITHERROR`status, it will transit to `RUNNINGWITHERROR`; if it is in `PREPSUSPENDED`status, it will transit to `PREP`status. When the coordinator job is resumed it will create all the coordinator actions that should have been created during the time it was suspended, actions will not be lost, they will delayed. -When the bundle job is resumed, suspended coordinators will resume running. If the bundle job is in =SUSPENDED=status, it will transit to =RUNNING=status; if it is in =SUSPENDEDWITHERROR=status, it will transit to =RUNNINGWITHERROR=; if it is in =PREPSUSPENDED=status, it will transit to =PREP=status. +When the bundle job is resumed, suspended coordinators will resume running. If the bundle job is in `SUSPENDED`status, it will transit to `RUNNING`status; if it is in `SUSPENDEDWITHERROR`status, it will transit to `RUNNINGWITHERROR`; if it is in `PREPSUSPENDED`status, it will transit to `PREP`status. ----+++ Killing a Workflow, Coordinator or Bundle Job +### Killing a Workflow, Coordinator or Bundle Job Example: -<verbatim> + +``` $ oozie job -oozie http://localhost:11000/oozie -kill 14-20090525161321-oozie-joe -</verbatim> +``` -The =kill= option kills a workflow job in =PREP=, =SUSPENDED= or =RUNNING= status and a coordinator/bundle job in -=PREP=, =RUNNING=, =PREPSUSPENDED=, =SUSPENDED=, =PREPPAUSED=, or =PAUSED= status. +The `kill` option kills a workflow job in `PREP`, `SUSPENDED` or `RUNNING` status and a coordinator/bundle job in +`PREP`, `RUNNING`, `PREPSUSPENDED`, `SUSPENDED`, `PREPPAUSED`, or `PAUSED` status. -After the command is executed the job will be in =KILLED= status. +After the command is executed the job will be in `KILLED` status. ----+++ Killing a Coordinator Action or Multiple Actions +### Killing a Coordinator Action or Multiple Actions Example: -<verbatim> + +``` $oozie job -kill <coord_Job_id> [-action 1, 3-4, 7-40] [-date 2009-01-01T01:00Z::2009-05-31T23:59Z, 2009-11-10T01:00Z, 2009-12-31T22:00Z] -</verbatim> +``` - * The =kill= option here for a range of coordinator actions kills a non-terminal (=RUNNING=, =WAITING=, =READY=, =SUSPENDED=) coordinator action when coordinator job is not in =FAILED= or =KILLED= state. + * The `kill` option here for a range of coordinator actions kills a non-terminal (`RUNNING`, `WAITING`, `READY`, `SUSPENDED`) coordinator action when coordinator job is not in `FAILED` or `KILLED` state. * Either -action or -date should be given. * If neither -action nor -date is given, the exception will be thrown. Also if BOTH -action and -date are given, an error will be thrown. * Multiple ranges can be used in -action or -date. See the above example. * If one of the actions in the given list of -action is already in terminal state, the output of this command will only include the other actions. * The dates specified in -date must be UTC. * Single date specified in -date must be able to find an action with matched nominal time to be effective. - * After the command is executed the killed coordinator action will have =KILLED= status. + * After the command is executed the killed coordinator action will have `KILLED` status. ----+++ Changing endtime/concurrency/pausetime/status of a Coordinator Job +### Changing endtime/concurrency/pausetime/status of a Coordinator Job Example: -<verbatim> + +``` $ oozie job -oozie http://localhost:11000/oozie -change 14-20090525161321-oozie-joe -value endtime=2011-12-01T05:00Z\;concurrency=100\;2011-10-01T05:00Z $ oozie job -oozie http://localhost:11000/oozie -change 0000001-140321155112907-oozie-puru-C -value status=RUNNING -</verbatim> +``` -The =endtime/concurrency/pausetime= option changes a coordinator job that is not in =KILLED= status. +The `endtime/concurrency/pausetime` option changes a coordinator job that is not in `KILLED` status. Valid value names are: + * endtime: the end time of the coordinator job. * concurrency: the concurrency of the coordinator job. * pausetime: the pause time of the coordinator job. * status: new status for coordinator job. Conditions and usage: + * Repeated value names are not allowed. * New end time should not be before job's start time and last action time. * If end time is before job start time and if the job has not materialized any actions, then job status is changed to SUCCEEDED. @@ -470,85 +493,91 @@ Conditions and usage: After the command is executed the job's end time, concurrency or pause time should be changed. If an already-succeeded job changes its end time, its status will become running. ----+++ Changing endtime/pausetime of a Bundle Job +### Changing endtime/pausetime of a Bundle Job Example: -<verbatim> + +``` $ oozie job -oozie http://localhost:11000/oozie -change 14-20090525161321-oozie-joe -value pausetime=2011-12-01T05:00Z -</verbatim> +``` -The =change= option changes a bundle job that is not in =KILLED= status. +The `change` option changes a bundle job that is not in `KILLED` status. Valid value names are: + * pausetime: the pause time of the bundle job. * endtime: the end time of the bundle job. Repeated value names are not allowed. An empty string "" can be used to reset pause time to none. New end time should not be before job's kickoff time. -Bundle will execute pause/end date change command on each coordinator job. Refer conditions and usage section of coordinator change command for more details [[DG_CommandLineTool#Changing_endtimeconcurrencypausetimestatus_of_a_Coordinator_Job][Coordinator job change command]]. +Bundle will execute pause/end date change command on each coordinator job. Refer conditions and usage section of coordinator change command for more details [Coordinator job change command](DG_CommandLineTool.html#Changing_endtimeconcurrencypausetimestatus_of_a_Coordinator_Job). ----+++ Rerunning a Workflow Job +### Rerunning a Workflow Job Example: -<verbatim> + +``` $ oozie job -oozie http://localhost:11000/oozie -config job.properties -rerun 14-20090525161321-oozie-joe -</verbatim> +``` -The =rerun= option reruns a completed ( =SUCCEEDED=, =FAILED= or =KILLED= ) job skipping the specified nodes. +The `rerun` option reruns a completed ( `SUCCEEDED`, `FAILED` or `KILLED` ) job skipping the specified nodes. The parameters for the job must be provided in a file, either a Java Properties file (.properties) or a Hadoop XML -Configuration file (.xml). This file must be specified with the <code>-config</code> option. +Configuration file (.xml). This file must be specified with the `-config` option. -The workflow application path must be specified in the file with the =oozie.wf.application.path= property. The +The workflow application path must be specified in the file with the `oozie.wf.application.path` property. The specified path must be an HDFS path. -The list of nodes to skipped must be provided in the =oozie.wf.rerun.skip.nodes= property separated by commas. +The list of nodes to skipped must be provided in the `oozie.wf.rerun.skip.nodes` property separated by commas. -After the command is executed the job will be in =RUNNING= status. +After the command is executed the job will be in `RUNNING` status. -Refer to the [[DG_WorkflowReRun][Rerunning Workflow Jobs]] for details on rerun. +Refer to the [Rerunning Workflow Jobs](DG_WorkflowReRun.html) for details on rerun. ----+++ Rerunning a Coordinator Action or Multiple Actions +### Rerunning a Coordinator Action or Multiple Actions Example: -<verbatim> + +``` $oozie job -rerun <coord_Job_id> [-nocleanup] [-refresh] [-failed] [-config <arg>] [-action 1, 3-4, 7-40] (-action or -date is required to rerun.) [-date 2009-01-01T01:00Z::2009-05-31T23:59Z, 2009-11-10T01:00Z, 2009-12-31T22:00Z] (if neither -action nor -date is given, the exception will be thrown.) -</verbatim> +``` -The =rerun= option reruns a terminated (=TIMEDOUT=, =SUCCEEDED=, =KILLED=, =FAILED=, =IGNORED=) coordinator action when coordinator job -is not in =FAILED= or =KILLED= state. +The `rerun` option reruns a terminated (`TIMEDOUT`, `SUCCEEDED`, `KILLED`, `FAILED`, `IGNORED`) coordinator action when coordinator job +is not in `FAILED` or `KILLED` state. -After the command is executed the rerun coordinator action will be in =WAITING= status. +After the command is executed the rerun coordinator action will be in `WAITING` status. -Refer to the [[DG_CoordinatorRerun][Rerunning Coordinator Actions]] for details on rerun. +Refer to the [Rerunning Coordinator Actions](DG_CoordinatorRerun.html) for details on rerun. ----+++ Rerunning a Bundle Job +### Rerunning a Bundle Job Example: -<verbatim> + +``` $oozie job -rerun <bundle_Job_id> [-nocleanup] [-refresh] [-coordinator c1, c3, c4] (-coordinator or -date is required to rerun.) [-date 2009-01-01T01:00Z::2009-05-31T23:59Z, 2009-11-10T01:00Z, 2009-12-31T22:00Z] (if neither -coordinator nor -date is given, the exception will be thrown.) -</verbatim> +``` -The =rerun= option reruns coordinator actions belonging to specified coordinators within the specified date range. +The `rerun` option reruns coordinator actions belonging to specified coordinators within the specified date range. -After the command is executed the rerun coordinator action will be in =WAITING= status. +After the command is executed the rerun coordinator action will be in `WAITING` status. ----+++ Checking the Information and Status of a Workflow, Coordinator or Bundle Job or a Coordinator Action +### Checking the Information and Status of a Workflow, Coordinator or Bundle Job or a Coordinator Action Example: -<verbatim> + +``` $ oozie job -oozie http://localhost:11000/oozie -info 14-20090525161321-oozie-joe . .---------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -567,36 +596,37 @@ Action Name Type Status Transition External Id .---------------------------------------------------------------------------------------------------------------------------------------------------------------- hadoop1 map-reduce OK end job_200904281535_0254 SUCCEEDED - 2009-05-26 05:01 +0000 2009-05-26 05:01 +0000 .---------------------------------------------------------------------------------------------------------------------------------------------------------------- -</verbatim> +``` -The =info= option can display information about a workflow job or coordinator job or coordinator action. -The =info= option for a Coordinator job will retrieve the Coordinator actions ordered by nominal time. However, the =info= command may timeout if the number of Coordinator actions are very high. In that case, =info= should be used with =offset= and =len= option. +The `info` option can display information about a workflow job or coordinator job or coordinator action. +The `info` option for a Coordinator job will retrieve the Coordinator actions ordered by nominal time. However, the `info` command may timeout if the number of Coordinator actions are very high. In that case, `info` should be used with `offset` and `len` option. -The =offset= and =len= option should be used for pagination. offset determines the start offset of the action +The `offset` and `len` option should be used for pagination. offset determines the start offset of the action returned among all the actions that matched the filter criteria. len determines number of actions to be returned. -The =localtime= option displays times in local time, if not specified times are displayed in GMT. +The `localtime` option displays times in local time, if not specified times are displayed in GMT. -The =filter= option can be used to filter coordinator actions based on some criteria. -The filter option syntax is: <code><key><comparator><value>[;<key><comparator><value>]*</code>. -(Note escape <code>\</code> needed before semicolon to specify multiple names for filter in shell) +The `filter` option can be used to filter coordinator actions based on some criteria. +The filter option syntax is: `<key><comparator><value>[;<key><comparator><value>]*`. +(Note escape `\` needed before semicolon to specify multiple names for filter in shell) key: status or nominalTime -comparator: =, !=, <, <=, >, >= -value: valid status like SUCCEEDED, KILLED, RUNNING etc. Only = and != apply for status +comparator: `, !`, <, <`, >, >` +value: valid status like SUCCEEDED, KILLED, RUNNING etc. Only ` and !` apply for status value for nominalTime is valid date of the format yyyy-MM-dd'T'HH:mm'Z' (like 2014-06-01T00:00Z) Multiple values must be specified as different name value pairs. The query is formed by doing AND of all conditions, with the exception of = which uses OR if there are multiple values for the same key. For example, -filter 'status=RUNNING;status=WAITING;nominalTime>=2014-06-01T00:00Z' maps to query (status = RUNNING OR status = -WAITING) AND nominalTime >= 2014-06-01T00:00Z which returns all waiting or running actions with nominalTime >= +filter 'status`RUNNING;status`WAITING;nominalTime>`2014-06-01T00:00Z' maps to query (status ` RUNNING OR status = +WAITING) AND nominalTime >` 2014-06-01T00:00Z which returns all waiting or running actions with nominalTime >` 2014-06-01T00:00Z. -Currently, the filter option can be used only with an =info= option on Coordinator job. +Currently, the filter option can be used only with an `info` option on Coordinator job. -The =verbose= option gives more detailed information for all the actions, if checking for workflow job or coordinator job. -An example below shows how the =verbose= option can be used to gather action statistics information for a job: +The `verbose` option gives more detailed information for all the actions, if checking for workflow job or coordinator job. +An example below shows how the `verbose` option can be used to gather action statistics information for a job: -<verbatim> + +``` $ oozie job -oozie http://localhost:11000/oozie -info 0000001-111219170928042-oozie-para-W@mr-node -verbose ID : 0000001-111219170928042-oozie-para-W@mr-node ------------------------------------------------------------------------------------------------------------------------------------ @@ -615,23 +645,24 @@ Ended : 2011-12-20 01:12 External Stats : {"org.apache.hadoop.mapred.JobInProgress$Counter":{"TOTAL_LAUNCHED_REDUCES":1,"TOTAL_LAUNCHED_MAPS":1,"DATA_LOCAL_MAPS":1},"ACTION_TYPE":"MAP_REDUCE","FileSystemCounters":{"FILE_BYTES_READ":1746,"HDFS_BYTES_READ":1409,"FILE_BYTES_WRITTEN":3524,"HDFS_BYTES_WRITTEN":1547},"org.apache.hadoop.mapred.Task$Counter":{"REDUCE_INPUT_GROUPS":33,"COMBINE_OUTPUT_RECORDS":0,"MAP_INPUT_RECORDS":33,"REDUCE_SHUFFLE_BYTES":0,"REDUCE_OUTPUT_RECORDS":33,"SPILLED_RECORDS":66,"MAP_OUTPUT_BYTES":1674,"MAP_INPUT_BYTES":1409,"MAP_OUTPUT_RECORDS":33,"COMBINE_INPUT_RECORDS":0,"REDUCE_INPUT_RECORDS":33}} External ChildIDs : null ------------------------------------------------------------------------------------------------------------------------------------ -</verbatim> +``` The two fields External Stats and External ChildIDs display the action statistics information (that includes counter information in case of MR action and PigStats information in case of a pig action) and child ids of the given job. Note that the user can turn on/off External Stats by specifying the property _oozie.action.external.stats.write_ as _true_ or _false_ in workflow.xml. By default, it is set to false (not to collect External Stats). External ChildIDs will always be stored. ----+++ Listing all the Workflows for a Coordinator Action +### Listing all the Workflows for a Coordinator Action A coordinator action kicks off different workflows for its original run and all subsequent reruns. Getting a list of those workflow ids is a useful tool to keep track of your actions' runs and to go debug the workflow job logs if required. Along with ids, it also lists their statuses, and start and end times for quick reference. -This is achieved by using the Coordinator Action info command and specifying a flag *=allruns=* -along with the =info= command. +This is achieved by using the Coordinator Action info command and specifying a flag **`allruns`** +along with the `info` command. + -<verbatim> +``` $ oozie job -info 0000001-111219170928042-oozie-joe-C@1 -allruns -oozie http://localhost:11000/oozie . Job ID Status Started Ended @@ -642,13 +673,14 @@ Job ID Status Started Ended .---------------------------------------------------------------------------------------------------- 0000001-140324164318985-oozie-joe-W SUCCEEDED 2014-03-24 23:44 GMT 2014-03-24 23:44 GMT .---------------------------------------------------------------------------------------------------- -</verbatim> +``` + +### Listing all retry attempts of a workflow action ----+++ Listing all retry attempts of a workflow action +When retry-max is specified for an action in the workflow definition, and there is a failure, it will be retried till it succeeds or retry-max attempts are exhausted. To get information on all the retry attempts, `-retries` command can be used. -When retry-max is specified for an action in the workflow definition, and there is a failure, it will be retried till it succeeds or retry-max attempts are exhausted. To get information on all the retry attempts, =-retries= command can be used. -<verbatim> +``` $ oozie job -retries 0000000-161212175234862-oozie-puru-W@pig-node -oozie http://localhost:11000/oozie ID : 0000000-161212175234862-oozie-puru-W@pig-node @@ -669,14 +701,15 @@ End Time : Tue, 13 Dec 2016 01:56:27 GMT Console URL : http://localhost:50030/jobdetails.jsp?jobid=job_201612051339_2650 ------------------------------------------------------------------------------------------------------------------------------------ $ -</verbatim> +``` ----+++ Checking the xml definition of a Workflow, Coordinator or Bundle Job +### Checking the xml definition of a Workflow, Coordinator or Bundle Job Example: -<verbatim> + +``` $ oozie job -oozie http://localhost:11000/oozie -definition 14-20090525161321-oozie-joe . <workflow-app xmlns="uri:oozie:workflow:0.2" name="sm3-segment-2413"> @@ -686,23 +719,25 @@ $ oozie job -oozie http://localhost:11000/oozie -definition 14-20090525161321-oo <end name="end"/> </workflow-app> -</verbatim> +``` ----+++ Checking the server logs of a Workflow, Coordinator or Bundle Job +### Checking the server logs of a Workflow, Coordinator or Bundle Job Example: -<verbatim> + +``` $ oozie job -oozie http://localhost:11000/oozie -log 14-20090525161321-oozie-joe -</verbatim> +``` ----+++ Checking the server error logs of a Workflow, Coordinator or Bundle Job +### Checking the server error logs of a Workflow, Coordinator or Bundle Job Example: -<verbatim> + +``` $ oozie job -oozie http://localhost:11000/oozie -errorlog 0000000-150121110331712-oozie-puru-B 2015-01-21 11:33:29,090 WARN CoordSubmitXCommand:523 - SERVER[-] USER[-] GROUP[-] TOKEN[-] APP[-] JOB[0000000-150121110331712-oozie-puru-B] ACTION[] SAXException : org.xml.sax.SAXParseException; lineNumber: 20; columnNumber: 22; cvc-complex-type.2.4.a: Invalid content was found starting with element 'concurrency'. One of '{"uri:oozie:coordinator:0.2":controls, "uri:oozie:coordinator:0.2":datasets, "uri:oozie:coordinator:0.2":input-events, "uri:oozie:coordinator:0.2":output-events, "uri:oozie:coordinator:0.2":action}' is expected. @@ -722,39 +757,42 @@ org.xml.sax.SAXParseException; lineNumber: 20; columnNumber: 22; cvc-complex-typ at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.jaxp.validation.StreamValidatorHelper.validate(Unknown Source) at org.apache.xerces.jaxp.validation.ValidatorImpl.validate(Unknown Source) -</verbatim> +``` ----+++ Checking the audit logs of a Workflow, Coordinator or Bundle Job +### Checking the audit logs of a Workflow, Coordinator or Bundle Job Example: -<verbatim> + +``` $ oozie job -oozie http://localhost:11000/oozie -auditlog 0000000-150322000230582-oozie-puru-C 2015-03-22 00:04:35,494 INFO oozieaudit:520 - IP [-], USER [purushah], GROUP [null], APP [-], JOBID [0000000-150322000230582-oozie-puru-C], OPERATION [start], PARAMETER [null], STATUS [SUCCESS], HTTPCODE [200], ERRORCODE [null], ERRORMESSAGE [null] 2015-03-22 00:05:13,823 INFO oozieaudit:520 - IP [-], USER [purushah], GROUP [null], APP [-], JOBID [0000000-150322000230582-oozie-puru-C], OPERATION [suspend], PARAMETER [0000000-150322000230582-oozie-puru-C], STATUS [SUCCESS], HTTPCODE [200], ERRORCODE [null], ERRORMESSAGE [null] 2015-03-22 00:06:59,561 INFO oozieaudit:520 - IP [-], USER [purushah], GROUP [null], APP [-], JOBID [0000000-150322000230582-oozie-puru-C], OPERATION [suspend], PARAMETER [0000000-150322000230582-oozie-puru-C], STATUS [SUCCESS], HTTPCODE [200], ERRORCODE [null], ERRORMESSAGE [null] 2015-03-22 23:22:20,012 INFO oozieaudit:520 - IP [-], USER [purushah], GROUP [null], APP [-], JOBID [0000000-150322000230582-oozie-puru-C], OPERATION [suspend], PARAMETER [0000000-150322000230582-oozie-puru-C], STATUS [SUCCESS], HTTPCODE [200], ERRORCODE [null], ERRORMESSAGE [null] 2015-03-22 23:28:48,218 INFO oozieaudit:520 - IP [-], USER [purushah], GROUP [null], APP [-], JOBID [0000000-150322000230582-oozie-puru-C], OPERATION [resume], PARAMETER [0000000-150322000230582-oozie-puru-C], STATUS [SUCCESS], HTTPCODE [200], ERRORCODE [null], ERRORMESSAGE [null] -</verbatim> +``` ----+++ Checking the server logs for particular actions of a Coordinator Job +### Checking the server logs for particular actions of a Coordinator Job Example: -<verbatim> + +``` $ oozie job -log <coord_job_id> [-action 1, 3-4, 7-40] (-action is optional.) -</verbatim> +``` ----+++ Filtering the server logs with logfilter options +### Filtering the server logs with logfilter options User can provide multiple option to filter logs using -logfilter opt1=val1;opt2=val1;opt3=val1. This can be used to fetch only just logs of interest faster as fetching Oozie server logs is slow due to the overhead of pattern matching. Available options are: - * recent: Specify recent hours/min of logs to scan. The recent offset specified is taken relative to the =end= time specified, job end time or the current system time if the job is still running in that order of precedence. For eg: recent=3h or recent=30m will fetch logs starting 3 hours/30 minutes before the end time and up to the end time. H/h is used to denote hour and M/m is used to denote minutes. If no suffix is specified default is hours. - * start: Start time for scanning logs. Default is start time of the job. User can provide a valid date or offset similar to =recent= option. Valid date formats are "yyyy-MM-dd'T'HH:mm'Z'" and "yyyy-MM-dd HH:mm:ss,SSS". When an offset is specified, it is calculated relative to the start time of the job. For eg: start=2h will fetch logs starting 2 hours after the job was started. - * end: End time for scanning logs. Default is end time of the job or current system time if the job is still running. User can provide a valid date or offset similar to =start= option. When an offset is specified, it is calculated relative to start time i.e job start time . For eg: end=2h will fetch logs from start time and start time plus 2 hours. + + * recent: Specify recent hours/min of logs to scan. The recent offset specified is taken relative to the `end` time specified, job end time or the current system time if the job is still running in that order of precedence. For eg: recent=3h or recent=30m will fetch logs starting 3 hours/30 minutes before the end time and up to the end time. H/h is used to denote hour and M/m is used to denote minutes. If no suffix is specified default is hours. + * start: Start time for scanning logs. Default is start time of the job. User can provide a valid date or offset similar to `recent` option. Valid date formats are "yyyy-MM-dd'T'HH:mm'Z'" and "yyyy-MM-dd HH:mm:ss,SSS". When an offset is specified, it is calculated relative to the start time of the job. For eg: start=2h will fetch logs starting 2 hours after the job was started. + * end: End time for scanning logs. Default is end time of the job or current system time if the job is still running. User can provide a valid date or offset similar to `start` option. When an offset is specified, it is calculated relative to start time i.e job start time . For eg: end=2h will fetch logs from start time and start time plus 2 hours. * loglevel : Multiple log levels separated by "|" can be specified. Supported log levels are ALL, DEBUG, ERROR, INFO, TRACE, WARN, FATAL. * text: String to search in logs. * limit : Limit number of line to be searched. Log search will end when when n lines(excluding stack-trace) have been matched. @@ -763,7 +801,8 @@ Available options are: Examples. Searching log with log level ERROR or WARN will only give log with Error and Warning (with stack-trace) only. This will be useful if job has failed and user want to find error logs with exception. -<verbatim> + +``` $ ./oozie job -log 0000006-140319184715726-oozie-puru-W -logfilter loglevel=WARN\;limit=3 -oozie http://localhost:11000/oozie/ 2014-03-20 10:01:52,977 WARN ActionStartXCommand:542 - SERVER[ ] USER[-] GROUP[-] TOKEN[] APP[map-reduce-wf] JOB[0000006-140319184715726-oozie-puru-W] ACTION[0000006-140319184715726-oozie-puru-W@:start:] [***0000006-140319184715726-oozie-puru-W@:start:***]Action status=DONE @@ -787,20 +826,22 @@ Caused by: java.io.IOException: Queue "aaadefault" does not exist at org.apache.hadoop.mapred.JobTracker.submitJob(JobTracker.java:3613) ... 12 more $ -</verbatim> +``` Search with specific text and recent option. -<verbatim> + +``` $ ./oozie job -log 0000003-140319184715726-oozie-puru-C -logfilter text=Missing\;limit=4\;recent=1h -oozie http://localhost:11000/oozie/ 2014-03-20 09:59:50,329 INFO CoordActionInputCheckXCommand:539 - SERVER[ ] USER[-] GROUP[-] TOKEN[-] APP[-] JOB[0000003-140319184715726-oozie-puru-C] ACTION[0000003-140319184715726-oozie-puru-C@1] [0000003-140319184715726-oozie-puru-C@1]::CoordActionInputCheck:: Missing deps:hdfs://localhost:9000/user/purushah/examples/input-data/rawLogs/ 2014-03-20 09:59:50,330 INFO CoordActionInputCheckXCommand:539 - SERVER[ ] USER[-] GROUP[-] TOKEN[-] APP[-] JOB[0000003-140319184715726-oozie-puru-C] ACTION[0000003-140319184715726-oozie-puru-C@1] [0000003-140319184715726-oozie-puru-C@1]::ActionInputCheck:: In checkListOfPaths: hdfs://localhost:9000/user/purushah/examples/input-data/rawLogs/ is Missing. 2014-03-20 10:02:19,087 INFO CoordActionInputCheckXCommand:539 - SERVER[ ] USER[-] GROUP[-] TOKEN[-] APP[-] JOB[0000003-140319184715726-oozie-puru-C] ACTION[0000003-140319184715726-oozie-puru-C@2] [0000003-140319184715726-oozie-puru-C@2]::CoordActionInputCheck:: Missing deps:hdfs://localhost:9000/user/purushah/examples/input-data/rawLogs/ 2014-03-20 10:02:19,088 INFO CoordActionInputCheckXCommand:539 - SERVER[ ] USER[-] GROUP[-] TOKEN[-] APP[-] JOB[0000003-140319184715726-oozie-puru-C] ACTION[0000003-140319184715726-oozie-puru-C@2] [0000003-140319184715726-oozie-puru-C@2]::ActionInputCheck:: In checkListOfPaths: hdfs://localhost:9000/user/purushah/examples/input-data/rawLogs/ is Missing. $ -</verbatim> +``` Search example with specific date range. -<verbatim> + +``` $ ./oozie job -log 0000003-140319184715726-oozie-puru-C -logfilter "start=2014-03-20 10:00:57,063;end=2014-03-20 10:10:57,063" -oozie http://localhost:11000/oozie/ 2014-03-20 10:00:57,063 INFO CoordActionUpdateXCommand:539 - SERVER[ ] USER[-] GROUP[-] TOKEN[-] APP[-] JOB[0000003-140319184715726-oozie-puru-C] ACTION[0000003-140319184715726-oozie-puru-C@1] Updating Coordinator action id :0000003-140319184715726-oozie-puru-C@1 status to KILLED, pending = 0 2014-03-20 10:02:18,967 INFO CoordMaterializeTransitionXCommand:539 - SERVER[ ] USER[-] GROUP[-] TOKEN[] APP[aggregator-coord] JOB[0000003-140319184715726-oozie-puru-C] ACTION[-] materialize actions for tz=Coordinated Universal Time, @@ -811,15 +852,16 @@ $ ./oozie job -log 0000003-140319184715726-oozie-puru-C -logfilter "start=2014- 2014-03-20 10:02:18,971 WARN CoordELFunctions:542 - SERVER[ ] USER[-] GROUP[-] TOKEN[] APP[aggregator-coord] JOB[0000003-140319184715726-oozie-puru-C] ACTION[-] If the initial instance of the dataset is later than the current-instance specified, such as coord:current(-200) in this case, an empty string is returned. This means that no data is available at the current-instance specified by the user and the user could try modifying his initial-instance to an earlier time. 2014-03-20 10:02:18,975 INFO CoordMaterializeTransitionXCommand:539 - SERVER[ ] USER[-] GROUP[-] TOKEN[] APP[aggregator-coord] JOB[0000003-140319184715726-oozie-puru-C] ACTION[-] [0000003-140319184715726-oozie-puru-C]: all actions have been materialized, set pending to true 2014-03-20 10:02:18,975 INFO CoordMaterializeTransitionXCommand:539 - SERVER[ ] USER[-] GROUP[-] TOKEN[] APP[aggregator-coord] JOB[0000003-140319184715726-oozie-puru-C] ACTION[-] Coord Job status updated to = RUNNING -</verbatim> +``` ----+++ Dryrun of Coordinator Job +### Dryrun of Coordinator Job * This feature is only supported in Oozie 2.0 or later. Example: -<verbatim> + +``` $ oozie job -oozie http://localhost:11000/oozie -dryrun -config job.properties ***coordJob after parsing: *** @@ -856,47 +898,49 @@ start="2009-03-06T010:00Z" end="2009-03-20T11:00Z" timezone="America/Los_Angeles </coordinator-app> ------------------------------------------------------------------------------------------------------------------------------------ -</verbatim> +``` -The =dryrun= option tests running a coordinator job with given job properties and does not create the job. +The `dryrun` option tests running a coordinator job with given job properties and does not create the job. The parameters for the job must be provided in a file, either a Java Properties file (.properties) or a Hadoop XML -Configuration file (.xml). This file must be specified with the <code>-config</code> option. +Configuration file (.xml). This file must be specified with the `-config` option. -The coordinator application path must be specified in the file with the =oozie.coord.application.path= property. The +The coordinator application path must be specified in the file with the `oozie.coord.application.path` property. The specified path must be an HDFS path. ----+++ Dryrun of Workflow Job +### Dryrun of Workflow Job * This feature is only supported in Oozie 3.3.2 or later. Example: -<verbatim> + +``` $ oozie job -oozie http://localhost:11000/oozie -dryrun -config job.properties OK -</verbatim> +``` -The =dryrun= option tests running a workflow job with given job properties and does not create the job. +The `dryrun` option tests running a workflow job with given job properties and does not create the job. The parameters for the job must be provided in a file, either a Java Properties file (.properties) or a Hadoop XML -Configuration file (.xml). This file must be specified with the <code>-config</code> option. +Configuration file (.xml). This file must be specified with the `-config` option. -The workflow application path must be specified in the file with the =oozie.wf.application.path= property. The +The workflow application path must be specified in the file with the `oozie.wf.application.path` property. The specified path must be an HDFS path. -If the workflow is accepted (i.e. Oozie is able to successfully read and parse it), it will return ="OK"=; otherwise, it will return +If the workflow is accepted (i.e. Oozie is able to successfully read and parse it), it will return `"OK"`; otherwise, it will return an error message describing why it was rejected. ----+++ Dryrun of Bundle Job +### Dryrun of Bundle Job * This feature is only supported in Oozie 5.1 or later. Example: -<verbatim> + +``` $ oozie job -oozie http://localhost:11000/oozie -dryrun -config job.properties ***Bundle job after parsing: *** @@ -929,17 +973,17 @@ $ oozie job -oozie http://localhost:11000/oozie -dryrun -config job.properties </coordinator> </bundle-app> -</verbatim> +``` -The =dryrun= option tests running a bundle job with given job properties and does not create the job. +The `dryrun` option tests running a bundle job with given job properties and does not create the job. The parameters for the job must be provided in a file, either a Java Properties file (.properties) or a Hadoop XML -Configuration file (.xml). This file must be specified with the <code>-config</code> option. +Configuration file (.xml). This file must be specified with the `-config` option. If the bundle job is accepted (i.e. Oozie is able to successfully read and parse it), it will return the parsed bundle job in xml; otherwise, it will return an error message describing why it was rejected. ----+++ Updating coordinator definition and properties +### Updating coordinator definition and properties Existing coordinator definition will be replaced by new definition. The refreshed coordinator would keep the same coordinator ID, state, and coordinator actions. All created coord action(including in WAITING) will use old configuration. One can rerun actions with -refresh option, -refresh option will use new configuration to rerun coord action @@ -948,13 +992,14 @@ Update command also verifies coordinator definition like submit command, if ther Update command with -dryrun will show coordinator definition and properties differences. Config option is optional, if not specified existing coordinator property is used to find coordinator path. -Update command doesn't allow update of coordinator name, frequency, start time, end time and timezone and will fail on an attempt to change any of them. To change end time of coordinator use the =-change= command. +Update command doesn't allow update of coordinator name, frequency, start time, end time and timezone and will fail on an attempt to change any of them. To change end time of coordinator use the `-change` command. To change the entire XML for a running coordinator, hdfs path for the new XML can be specified -as =oozie.coord.application.path= in job.properties. Then, use <code>-config job.properties</code> in the update command. +as `oozie.coord.application.path` in job.properties. Then, use `-config job.properties` in the update command. -<verbatim> + +``` $ oozie job -oozie http://localhost:11000/oozie -config job.properties -update 0000005-140402104721140-oozie-puru-C -dryrun . **********Job definition changes********** @@ -994,62 +1039,66 @@ $ oozie job -oozie http://localhost:11000/oozie -config job.properties -update 0 <value>localhost:9001</value> </property> ********************************** -</verbatim> +``` ----+++ Ignore a Coordinator Job +### Ignore a Coordinator Job Example: -<verbatim> + +``` $oozie job -ignore <coord_Job_id> -</verbatim> +``` -The =ignore= option changes a coordinator job in =KILLED=, =FAILED= to =IGNORED= state. -When a coordinator job in a bundle is in =IGNORED= state, the coordinator job doesn't impact the state of the bundle job. -For example, when a coordinator job in a bundle failed and afterwards ignored, the bundle job becomes =SUCCEEDED= instead of =DONEWITHERROR= as long as other coordinator jobs in the bundle succeeded. - A ignored coordinator job can be changed to =RUNNING= using -change command. - Refer to the [[DG_CommandLineTool#Changing_endtimeconcurrencypausetimestatus_of_a_Coordinator_Job][Coordinator job change command]] for details. +The `ignore` option changes a coordinator job in `KILLED`, `FAILED` to `IGNORED` state. +When a coordinator job in a bundle is in `IGNORED` state, the coordinator job doesn't impact the state of the bundle job. +For example, when a coordinator job in a bundle failed and afterwards ignored, the bundle job becomes `SUCCEEDED` instead of `DONEWITHERROR` as long as other coordinator jobs in the bundle succeeded. + A ignored coordinator job can be changed to `RUNNING` using -change command. + Refer to the [Coordinator job change command](DG_CommandLineTool.html#Changing_endtimeconcurrencypausetimestatus_of_a_Coordinator_Job) for details. ----+++ Ignore a Coordinator Action or Multiple Coordinator Actions +### Ignore a Coordinator Action or Multiple Coordinator Actions Example: -<verbatim> + +``` $oozie job -ignore <coord_Job_id> -action 1,3-4,7-40 -</verbatim> -The =ignore= option changes a coordinator action(s) in terminal state (=KILLED=, =FAILED=, =TIMEDOUT=) to =IGNORED= state, while not changing the state of the coordinator job. -When a coordinator action is in =IGNORED= state, the action doesn't impact the state of a coordinator job. -For example, when a coordinator action failed and afterwards ignored, a coordinator job becomes =SUCCEEDED= instead of =DONEWITHERROR= as long +``` +The `ignore` option changes a coordinator action(s) in terminal state (`KILLED`, `FAILED`, `TIMEDOUT`) to `IGNORED` state, while not changing the state of the coordinator job. +When a coordinator action is in `IGNORED` state, the action doesn't impact the state of a coordinator job. +For example, when a coordinator action failed and afterwards ignored, a coordinator job becomes `SUCCEEDED` instead of `DONEWITHERROR` as long as other coordinator actions succeeded. A ignored coordinator action can be rerun using -rerun command. -Refer to the [[DG_CoordinatorRerun][Rerunning Coordinator Actions]] for details. -When a workflow job of a ignored coordinator action is rerun, the coordinator action becomes =RUNNING= state. +Refer to the [Rerunning Coordinator Actions](DG_CoordinatorRerun.html) for details. +When a workflow job of a ignored coordinator action is rerun, the coordinator action becomes `RUNNING` state. ----+++ Polling an Oozie job +### Polling an Oozie job -This command allows polling the Oozie server for an Oozie job until it reaches a completed status (e.g. =SUCCEEDED=, =KILLED=, etc). +This command allows polling the Oozie server for an Oozie job until it reaches a completed status (e.g. `SUCCEEDED`, `KILLED`, etc). Example: -<verbatim> + +``` $ oozie job -poll <job_id> -interval 10 -timeout 60 -verbose . RUNNING RUNNING RUNNING SUCCEEDED -</verbatim> +``` -The =-poll= argument takes a valid Workflow Job ID, Coordinator Job ID, Coordinator Action ID, or Bundle Job ID. +The `-poll` argument takes a valid Workflow Job ID, Coordinator Job ID, Coordinator Action ID, or Bundle Job ID. All other arguments are optional: - * =verbose= will cause the job status to be printed at each poll; otherwise, there will be no output - * =interval= allows specifying the polling interval in minutes (default is 5) - * =timeout= allows specifying the timeout in minutes (default is 30 minutes); negative values indicate no timeout ----+++ Changing job SLA definition and alerting + * `verbose` will cause the job status to be printed at each poll; otherwise, there will be no output + * `interval` allows specifying the polling interval in minutes (default is 5) + * `timeout` allows specifying the timeout in minutes (default is 30 minutes); negative values indicate no timeout + +### Changing job SLA definition and alerting * slaenable command can be used to enable job sla alerts. * sladisable command can be used to disable job sla alerts. * slachange command can be used to change sla job definition. @@ -1059,20 +1108,22 @@ All other arguments are optional: * Sla commands with -action or -date parameter will be applied to only non terminated actions. Eg. - <verbatim> + +``` $oozie job -slaenable <coord_Job_id> [-action 1,3-4,7-40] [-date 2009-01-01T01:00Z::2009-05-31T23:59Z,2009-11-10T01:00Z::2009-12-31T22:00Z] $oozie job -sladisable <coord_Job_id> [-action 1,3-4,7-40] [-date 2009-01-01T01:00Z::2009-05-31T23:59Z,2009-11-10T01:00Z::2009-12-31T22:00Z] - $oozie job -slachange <coord_Job_id> [-action 1,3-4,7-40] [-date 2009-01-01T01:00Z::2009-05-31T23:59Z,2009-11-10T01:00Z::2009-12-31T22:00Z] -value 'sla-max-duration=${10 * MINUTES};sla-should-end=${30 * MINUTES};sla-max-duration=${30 * MINUTES}' + $oozie job -slachange <coord_Job_id> [-action 1,3-4,7-40] [-date 2009-01-01T01:00Z::2009-05-31T23:59Z,2009-11-10T01:00Z::2009-12-31T22:00Z] -value 'sla-max-duration=${10 ** MINUTES};sla-should-end=${30 ** MINUTES};sla-max-duration=${30 * MINUTES}' $oozie job -slaenable <bundle_job_id> [-action 1,3-4,7-40] [-date 2009-01-01T01:00Z::2009-05-31T23:59Z,2009-11-10T01:00Z::2009-12-31T22:00Z] [-coordinator <List_of_coord_names/ids] - </verbatim> +``` ----+++ Getting missing dependencies of coordinator action(s) +### Getting missing dependencies of coordinator action(s) * Coordination action id can be specified directly for getting missing dependencies of a single action. * To get information on multiple actions, either -action or -date option can be specified with the coordinator job id. * missingdeps command doesn't recompute dependencies. It list missing dependencies which were last computed. - * Oozie checks missing dependencies sequentially, and it will stop on first missing dependency. =Blocked On= is the first missing dependency for action. So, there could be a chance that Oozie will report some missing dependencies, but it might be present. To resolve the waiting issue, one should fix the blockedOn missing dependency. + * Oozie checks missing dependencies sequentially, and it will stop on first missing dependency. `Blocked On` is the first missing dependency for action. So, there could be a chance that Oozie will report some missing dependencies, but it might be present. To resolve the waiting issue, one should fix the blockedOn missing dependency. * For input logic, missingdeps command doesn't compute input-logic expression. It will report everything which is missing or not computed. -<verbatim> + +``` $oozie job -oozie http://localhost:11000/oozie -missingdeps 0000000-170104141851590-oozie-puru-C -action 1 $oozie job -oozie http://localhost:11000/oozie -missingdeps 0000000-170104141851590-oozie-puru-C@1 . @@ -1090,34 +1141,37 @@ Pending Dependencies : hdfs://localhost:9000/user/purushah/examples/input-data/rawLogs/2010/01/01/00/20/_SUCCESS hdfs://localhost:9000/user/purushah/examples/input-data/rawLogs/2010/01/01/00/00/_SUCCESS $ -</verbatim> +``` ----+++ Checking a workflow definition generated by a Fluent Job API jar file +### Checking a workflow definition generated by a Fluent Job API jar file Since Oozie 5.1.0. Generate a workflow definition given the Fluent Job API jar file supplied at command line, and check for its correctness. -*Preconditions:* +**Preconditions:** + * the Fluent Job API jar file has to be present and readable by the current user at the local path provided * the folder containing the Fluent Job API jar file provided has to be writable by the current user, since the generated workflow definition is written there -If the =-verbose= option is provided, a lot more debugging output, including the generated workflow definition, is given. +If the `-verbose` option is provided, a lot more debugging output, including the generated workflow definition, is given. For more information what an Fluent Job API jar file is, how to build it etc., -refer to [[DG_FluentJobAPI#AE.A_Appendix_A_API_JAR_format][Fluent Job API - API JAR format]]. +refer to [Fluent Job API - API JAR format](DG_FluentJobAPI.html#AE.A_Appendix_A_API_JAR_format). -*Example:* +**Example:** -<verbatim> + +``` $ oozie job -oozie http://localhost:11000/oozie -validatejar /tmp/workflow-api-jar.jar Valid workflow-app -</verbatim> +``` + +**Example (verbose):** -*Example (verbose):* -<verbatim> +``` $ oozie job -oozie http://localhost:11000/oozie -validatejar /tmp/workflow-api-jar.jar -verbose Checking API jar:/tmp/workflow-api-jar.jar Loading API jar /tmp/workflow-api-jar.jar @@ -1131,39 +1185,42 @@ API jar is written to /tmp/workflow1876390751841950810.xml Servlet response is: Valid workflow-app API jar is valid. -</verbatim> +``` ----+++ Submitting a workflow definition generated by a Fluent Job API jar file +### Submitting a workflow definition generated by a Fluent Job API jar file Since Oozie 5.1.0. Generate a workflow definition given the Fluent Job API jar file supplied at command line, write it to a provided or generated HDFS location, and submit. -*Preconditions:* +**Preconditions:** + * all the parameters that are present in the workflow definition have to be supplied either as command line parameters or via - =job.properties= passed along with the =-config= option + `job.properties` passed along with the `-config` option * the Fluent Job API jar file has to be present and readable by the current user at the local path provided * the folder containing the Fluent Job API jar file provided has to be writable by the current user, since the generated workflow definition is written there - * the HDFS folder either given by =-Doozie.wf.application.path= command line parameter, or in its absence contained by - =oozie-site.xml#oozie.client.jobs.application.generated.path= has to be writable by the current user + * the HDFS folder either given by `-Doozie.wf.application.path` command line parameter, or in its absence contained by + `oozie-site.xml#oozie.client.jobs.application.generated.path` has to be writable by the current user -If the =-verbose= option is provided, a lot more debugging output, including the generated workflow definition, is given. +If the `-verbose` option is provided, a lot more debugging output, including the generated workflow definition, is given. For more information what an Fluent Job API jar file is, how to build it etc., refer to -[[DG_FluentJobAPI#AE.A_Appendix_A_API_JAR_format][Fluent Job API - API JAR format]]. +[Fluent Job API - API JAR format](DG_FluentJobAPI.html#AE.A_Appendix_A_API_JAR_format). + +**Example:** -*Example:* -<verbatim> +``` $ oozie job -oozie http://localhost:11000/oozie -submitjar /tmp/workflow-api-jar.jar -config /tmp/job.properties job: 0000009-180107110323219-oozie-oozi-W -</verbatim> +``` + +**Example (verbose):** -*Example (verbose):* -<verbatim> +``` $ oozie job -oozie http://localhost:11000/oozie -submitjar /tmp/workflow-api-jar.jar -config /tmp/job.properties -verbose Submitting a job based on API jar: /tmp/workflow-api-jar.jar Loading API jar /tmp/workflow-api-jar.jar @@ -1175,39 +1232,42 @@ Workflow job definition generated from API jar: . job: 0000010-180107110323219-oozie-oozi-W Job based on API jar submitted successfully. -</verbatim> +``` ----+++ Running a workflow definition generated by a Fluent Job API jar file +### Running a workflow definition generated by a Fluent Job API jar file Since Oozie 5.1.0. Generate a workflow definition given the Fluent Job API jar file supplied at command line, write it to a provided or generated HDFS location, submit and run. -*Preconditions:* +**Preconditions:** + * all the parameters that are present in the workflow definition have to be supplied either as command line parameters or via - =job.properties= passed along with the =-config= option + `job.properties` passed along with the `-config` option * the Fluent Job API jar file has to be present and readable by the current user at the local path provided * the folder containing the Fluent Job API jar file provided has to be writable by the current user, since the generated workflow definition is written there - * the HDFS folder either given by =-Doozie.wf.application.path= command line parameter, or in its absence contained by - =oozie-site.xml#oozie.client.jobs.application.generated.path= has to be writable by the current user + * the HDFS folder either given by `-Doozie.wf.application.path` command line parameter, or in its absence contained by + `oozie-site.xml#oozie.client.jobs.application.generated.path` has to be writable by the current user -If the =-verbose= option is provided, a lot more debugging output, including the generated workflow definition, is given. +If the `-verbose` option is provided, a lot more debugging output, including the generated workflow definition, is given. For more information what an Fluent Job API jar file is, how to build it etc., refer to -[[DG_FluentJobAPI#AE.A_Appendix_A_API_JAR_format][Fluent Job API - API JAR format]]. +[Fluent Job API - API JAR format](DG_FluentJobAPI.html#AE.A_Appendix_A_API_JAR_format). + +**Example:** -*Example:* -<verbatim> +``` $ oozie job -oozie http://localhost:11000/oozie -runjar /tmp/workflow-api-jar.jar -config /tmp/job.properties job: 0000011-180107110323219-oozie-oozi-W -</verbatim> +``` + +**Example (verbose):** -*Example (verbose):* -<verbatim> +``` $ oozie job -oozie http://localhost:11000/oozie -runjar /tmp/workflow-api-jar.jar -config /tmp/job.properties -verbose Submitting a job based on API jar: /tmp/workflow-api-jar.jar Loading API jar /tmp/workflow-api-jar.jar @@ -1219,15 +1279,16 @@ Workflow job definition generated from API jar: . job: 0000010-180107110323219-oozie-oozi-W Job based on API jar run successfully. -</verbatim> +``` ----++ Jobs Operations +## Jobs Operations ----+++ Checking the Status of multiple Workflow Jobs +### Checking the Status of multiple Workflow Jobs Example: -<verbatim> + +``` $ oozie jobs -oozie http://localhost:11000/oozie -localtime -len 2 -filter status=RUNNING . Job Id Workflow Name Status Run User Group Created Started Ended @@ -1235,20 +1296,20 @@ Job Id Workflow Name Status Run User 4-20090527151008-oozie-joe hadoopel-wf RUNNING 0 joe other 2009-05-27 15:34 +0530 2009-05-27 15:34 +0530 - 0-20090527151008-oozie-joe hadoopel-wf RUNNING 0 joe other 2009-05-27 15:15 +0530 2009-05-27 15:15 +0530 - .---------------------------------------------------------------------------------------------------------------------------------------------------------------- -</verbatim> +``` -The =jobs= sub-command will display information about multiple jobs. +The `jobs` sub-command will display information about multiple jobs. -The =offset= and =len= option specified the offset and number of jobs to display, default values are =1= and =100= +The `offset` and `len` option specified the offset and number of jobs to display, default values are `1` and `100` respectively. -The =localtime= option displays times in local time, if not specified times are displayed in GMT. +The `localtime` option displays times in local time, if not specified times are displayed in GMT. -The =verbose= option gives more detailed information for each job. +The `verbose` option gives more detailed information for each job. A filter can be specified after all options. -The =filter=option syntax is: <code>[NAME=VALUE][;NAME=VALUE]*</code>. +The `filter`option syntax is: `[NAME=VALUE][;NAME=VALUE]*`. Valid filter names are: @@ -1259,20 +1320,21 @@ Valid filter names are: * status: the status of the job. * startcreatedtime: the start of time window in specifying createdtime range filter. * endcreatedtime: the end of time window in specifying createdtime range filter - * sortby: order the results. Supported values for =sortby= are: =createdTime= and =lastModifiedTime= + * sortby: order the results. Supported values for `sortby` are: `createdTime` and `lastModifiedTime` The query will do an AND among all the filter names. The query will do an OR among all the filter values for the same name. Multiple values must be specified as different name value pairs. -startCreatedTime and endCreatedTime should be specified either in *ISO8601 (UTC)* format (*yyyy-MM-dd'T'HH:mm'Z'*) or a offset value in days or hours from the current time. For example, -2d means the current time - 2 days. -3h means the current time - 3 hours, -5m means the current time - 5 minutes +startCreatedTime and endCreatedTime should be specified either in **ISO8601 (UTC)** format (**yyyy-MM-dd'T'HH:mm'Z'**) or a offset value in days or hours from the current time. For example, -2d means the current time - 2 days. -3h means the current time - 3 hours, -5m means the current time - 5 minutes ----+++ Checking the Status of multiple Coordinator Jobs +### Checking the Status of multiple Coordinator Jobs * This feature is only supported in Oozie 2.0 or later. Example: -<verbatim> + +``` $ oozie jobs -oozie http://localhost:11000/oozie -jobtype coordinator . Job ID App Name Status Freq Unit Started Next Materialized @@ -1281,9 +1343,9 @@ Job ID .---------------------------------------------------------------------------------------------------------------------------------------------------------------- 0003823-100531045722929-oozie-wrkf-C coordcal2880minutescurrent SUCCEEDED 2880 MINUTE 2010-02-01 16:30 2010-02-05 16:30 .---------------------------------------------------------------------------------------------------------------------------------------------------------------- -</verbatim> +``` -The =jobtype= option specified the job type to display, default value is 'wf'. To see the coordinator jobs, value is 'coordinator'. +The `jobtype` option specified the job type to display, default value is 'wf'. To see the coordinator jobs, value is 'coordinator'. Valid filter names are: @@ -1293,15 +1355,16 @@ Valid filter names are: * status: the status of the job. * frequency: the frequency of the Coordinator job. * unit: the time unit. It can take one of the following four values: months, days, hours or minutes. Time unit should be added only when frequency is specified. - * sortby: order the results. Supported values for =sortby= are: =createdTime= and =lastModifiedTime= + * sortby: order the results. Supported values for `sortby` are: `createdTime` and `lastModifiedTime` ----+++ Checking the Status of multiple Bundle Jobs +### Checking the Status of multiple Bundle Jobs * This feature is only supported in Oozie 3.0 or later. Example: -<verbatim> + +``` $ oozie jobs -oozie http://localhost:11000/oozie -jobtype bundle Job ID Bundle Name Status Kickoff Created User Group .------------------------------------------------------------------------------------------------------------------------------------ @@ -1311,15 +1374,16 @@ Job ID Bundle Name Status Kickoff .------------------------------------------------------------------------------------------------------------------------------------ 0000000-110322105610515-oozie-chao-B BUNDLE-TEST DONEWITHERROR2012-01-15 00:24 2011-03-22 17:58 joe users .------------------------------------------------------------------------------------------------------------------------------------ -</verbatim> +``` -The =jobtype= option specified the job type to display, default value is 'wf'. To see the bundle jobs, value is 'bundle'. +The `jobtype` option specified the job type to display, default value is 'wf'. To see the bundle jobs, value is 'bundle'. ----+++ Bulk kill, suspend or resume multiple jobs +### Bulk kill, suspend or resume multiple jobs Example: -<verbatim> + +``` $ oozie jobs -oozie http://localhost:11000/oozie -kill|-suspend|-resume -filter name=cron-coord -jobtype coordinator The following jobs have been killed|suspended|resumed Job ID App Name Status Freq Unit Started Next Materialized @@ -1330,21 +1394,21 @@ Job ID App Name Status Freq Unit .------------------------------------------------------------------------------------------------------------------------------------ 0000000-150224141553231-oozie-bzha-C cron-coord KILLED 10 MINUTE 2015-02-25 22:00 GMT - .------------------------------------------------------------------------------------------------------------------------------------ -</verbatim> +``` The above command will kill, suspend, or resume all the coordinator jobs with name of "cron-coord" starting with offset 1 to 50. -The =jobs= sub-command will bulk modify all the jobs that satisfy the filter, len, offset, and jobtype options when adding +The `jobs` sub-command will bulk modify all the jobs that satisfy the filter, len, offset, and jobtype options when adding a -kill|-suspend|-resume option. Another way to think about is the subcommand works to modify all the jobs that will be displayed if the write option(kill|suspend|resume) is not there. -The =offset= and =len= option specified the offset and number of jobs to be modified, default values are =1= and =50= +The `offset` and `len` option specified the offset and number of jobs to be modified, default values are `1` and `50` respectively. -The =jobtype= option specifies the type of jobs to be modified, be it "wf", "coordinator" or "bundle". default value is "wf". +The `jobtype` option specifies the type of jobs to be modified, be it "wf", "coordinator" or "bundle". default value is "wf". A filter can be specified after all options. -The =filter=option syntax is: <code>[NAME=VALUE][;NAME=VALUE]*</code>. +The `filter`option syntax is: `[NAME=VALUE][;NAME=VALUE]*`. Valid filter names are: @@ -1354,21 +1418,22 @@ Valid filter names are: * status: the status of the job. * frequency: the frequency of the Coordinator job. * unit: the time unit. It can take one of the following four values: months, days, hours or minutes. Time unit should be added only when frequency is specified. - * sortby: order the results. Supported values for =sortby= are: =createdTime= and =lastModifiedTime= + * sortby: order the results. Supported values for `sortby` are: `createdTime` and `lastModifiedTime` The query will do an AND among all the filter names. The query will do an OR among all the filter values for the same name. Multiple values must be specified as different name value pairs. The following example shows how to suspend the first 20 bundle jobs whose name is "bundle-app": -<verbatim> + +``` $ oozie jobs -oozie http://localhost:11000/oozie -suspend -filter name=bundle-app -jobtype bundle -len 20 -</verbatim> +``` ----+++ Bulk monitoring for jobs launched via Bundles +### Bulk monitoring for jobs launched via Bundles * This command-line query helps to directly query for a bulk of jobs using a set of rich filters. -The jobs need to have a parent *Bundle*, and this performs a deep query to provide results about all the workflows that satisfy your filters. +The jobs need to have a parent **Bundle**, and this performs a deep query to provide results about all the workflows that satisfy your filters. These results display relevant job-ids, app-names, and error message (if any) and are most helpful when you need to monitor a bulk of jobs and get a gist, while avoiding typing multiple queries. @@ -1376,20 +1441,22 @@ This feature is only supported in Oozie 3.3 or later. Example 1: -<verbatim> + +``` $ oozie jobs -oozie http://localhost:11000/oozie -bulk bundle=bundle-app-1 . Bundle Name Bundle ID Coord Name Coord Action ID External ID Status Created Time Error Message .------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- bundle-app-1 0000000-130408151805946-oozie-chit-B coord-1 0000001-130408151805946-oozie-chit-C@1 0000002-130408151805946-oozie-chit-W KILLED 2013-04-08 22:20 GMT null .------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -</verbatim> +``` Example 2: This example illustrates giving multiple arguments and -verbose option. _NOTE: The filter string after -bulk should be enclosed within quotes_ -<verbatim> + +``` . $ oozie jobs -oozie http://localhost:11000/oozie -bulk 'bundle=bundle-app-2;actionstatus=SUCCEEDED' -verbose . @@ -1404,7 +1471,7 @@ Created Time : 2013-04-23 01:43 GMT User : user_xyz Error Message : - .------------------------------------------------------------------------------------------------------------------------------------ -</verbatim> +``` You can type 'help' to view usage for the CLI options and filters available. Namely: @@ -1414,7 +1481,8 @@ You can type 'help' to view usage for the CLI options and filters available. Nam * startcreatedtime/endcreatedtime: specify boundaries for the created-time. Only jobs created within this window are included. * startscheduledtime/endscheduledtime: specify boundaries for the nominal-time. Only jobs scheduled to run within this window are included. -<verbatim> + +``` $ oozie jobs <OPTIONS> : jobs status -bulk <arg> key-value pairs to filter bulk jobs response. e.g. bundle=<B>\;coordinators=<C>\;actionstatus=<S>\; @@ -1423,57 +1491,61 @@ $ oozie jobs <OPTIONS> : jobs status coordinators and actionstatus can be multiple comma separated values. "bundle" and "coordinators" are 'names' of those jobs. Bundle name is mandatory, other params are optional -</verbatim> +``` Similar to the usual jobs filter, different filter arguments here should be separated by semicolon (;). ----++ Admin Operations +## Admin Operations ----+++ Checking the Status of the Oozie System +### Checking the Status of the Oozie System Example: -<verbatim> + +``` $ oozie admin -oozie http://localhost:11000/oozie -status . Safemode: OFF -</verbatim> +``` It returns the current status of the Oozie system. ----+++ Changing the Status of the Oozie System +### Changing the Status of the Oozie System * This feature is only supported in Oozie 2.0 or later. Example: -<verbatim> + +``` $ oozie admin -oozie http://localhost:11000/oozie -systemmode [NORMAL|NOWEBSERVICE|SAFEMODE] . Safemode: ON -</verbatim> +``` It returns the current status of the Oozie system. ----+++ Displaying the Build Version of the Oozie System +### Displaying the Build Version of the Oozie System Example: -<verbatim> + +``` $ oozie admin -oozie http://localhost:11000/oozie -version . Oozie server build version: 2.0.2.1-0.20.1.3092118008-- -</verbatim> +``` It returns the Oozie server build version. ----+++ Displaying the queue dump of the Oozie System +### Displaying the queue dump of the Oozie System * This feature is for administrator debugging purpose Example: -<verbatim> + +``` $ oozie admin -oozie http://localhost:11000/oozie -queuedump . [Server Queue Dump]: @@ -1481,29 +1553,31 @@ $ oozie admin -oozie http://localhost:11000/oozie -queuedump (coord_action_ready,1) (action.check,2) -</verbatim> +``` It returns the Oozie server current queued commands. ----+++ Displaying the list of available Oozie Servers +### Displaying the list of available Oozie Servers Example: -<verbatim> + +``` $ oozie admin -oozie http://hostA:11000/oozie -servers hostA : http://hostA:11000/oozie hostB : http://hostB:11000/oozie hostC : http://hostC:11000/oozie -</verbatim> +``` -It returns a list of available Oozie Servers. This is useful when Oozie is configured for [[AG_Install#HA][High Availability]]; if +It returns a list of available Oozie Servers. This is useful when Oozie is configured for [High Availability](AG_Install.html#HA); if not, it will simply return the one Oozie Server. ----+++ Displaying the Oozie server configuration +### Displaying the Oozie server configuration Example: -<verbatim> + +``` $ oozie admin -oozie http://localhost:11000/oozie -configuration local.realm : LOCALHOST oozie.JobCommand.job.console.url : http://localhost:11000/oozie?job= @@ -1515,19 +1589,20 @@ oozie.action.mapreduce.uber.jar.enable : false oozie.action.max.output.data : 2048 oozie.action.retries.max : 3 ... -</verbatim> +``` It returns a list of the configuration properties and values from oozie-site.xml and oozie-default.xml being used by the Oozie server. ----+++ Displaying the Oozie server OS environment +### Displaying the Oozie server OS environment Example: -<verbatim> + +``` $ oozie admin -oozie http://localhost:11000/oozie -osenv ... -JETTY_OPTS : -Doozie.home.dir=/Users/asasvari/dev/oozie -Doozie.config.dir=/Users/asasvari/dev/oozie/conf -Doozie.log.dir=/Users/asasvari/dev/oozie/logs -Doozie.data.dir=/Users/asasvari/dev/oozie/data -Doozie.config.file=oozie-site.xml -Doozie.log4j.file=oozie-log4j.properties -Doozie.log4j.reload=10 -Djava.library.path= -cp /Users/asasvari/dev/oozie/embedded-oozie-server/*:/Users/asasvari/dev/oozie/embedded-oozie-server/dependency/*:/Users/asasvari/dev/oozie/lib/*:/Users/asasvari/dev/oozie/libtools/*:/Users/asasvari/dev/oozie/embedded-oozie-server +JETTY_OPTS : -Doozie.home.dir=/Users/asasvari/dev/oozie -Doozie.config.dir=/Users/asasvari/dev/oozie/conf -Doozie.log.dir=/Users/asasvari/dev/oozie/logs -Doozie.data.dir=/Users/asasvari/dev/oozie/data -Doozie.config.file=oozie-site.xml -Doozie.log4j.file=oozie-log4j.properties -Doozie.log4j.reload=10 -Djava.library.path= -cp /Users/asasvari/dev/oozie/embedded-oozie-server/**:/Users/asasvari/dev/oozie/embedded-oozie-server/dependency/**:/Users/asasvari/dev/oozie/lib/**:/Users/asasvari/dev/oozie/libtools/**:/Users/asasvari/dev/oozie/embedded-oozie-server JETTY_OUT : /Users/asasvari/dev/oozie/logs/jetty.out JETTY_PID_FILE : /Users/asasvari/dev/oozie/embedded-oozie-server/oozie.pid OOZIE_CONFIG : /Users/asasvari/dev/oozie/conf @@ -1538,15 +1613,16 @@ OOZIE_LOG : /Users/asasvari/dev/oozie/logs OOZIE_LOG4J_FILE : oozie-log4j.properties OOZIE_LOG4J_RELOAD : 10 ... -</verbatim> +``` It returns a list of OS environment variables in the Oozie server. ----+++ Displaying the Oozie server Java system properties +### Displaying the Oozie server Java system properties Example: -<verbatim> + +``` $ oozie admin -oozie http://localhost:11000/oozie -javasysprops ... oozie.config.dir : /Users/asasvari/dev/oozie/conf @@ -1557,17 +1633,18 @@ oozie.log.dir : /Users/asasvari/dev/oozie/logs oozie.log4j.file : oozie-log4j.properties oozie.log4j.reload : 10 ... -</verbatim> +``` It returns a list of java system properties in the Oozie server. ----+++ Displaying the Oozie server Instrumentation +### Displaying the Oozie server Instrumentation Deprecated and by default disabled since 5.0.0. Example: -<verbatim> + +``` $
<TRUNCATED>