Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Excerpt
hiddentrue

Execute Jobs in Batch Mode

Index

What is Kitchen?

...

Installation

...



Kitchen? ?????

Anchor
Kitchen? ?????
Kitchen? ?????

Kitchen? Spoon?? ????? XML???? ?????? ???? ??? Job? ?? ? ? ?? ???? ???. ?????, Job? ?????? ???? ????? ?? ????? ???????.

??

Anchor
??
??

?? Sun Microsystems Java Runtime Environment 1.5 ?? ??? ???. ?? http://www.java.com/ ??? JRE? ?? ?? ? ????.After this, you can simply unzip

the distribution zip-file in a directory of your choice.
In the Kettle directory where you unzipped the file, you will find a number of files.
Under Unix-like environments (Solaris, Linux, OSX, ...) you will need to make the shell scripts executable. Execute these commands to make all shell scripts in the Kettle directory executable:? ?, ????? ??? zip??? ??? ????? ??? ?? ???.
??? ? Kettle ?????? ?? ?? ??? ?? ????. ??? ?? ?????, ??????? ???? ??? ??? ???.  ?? ??? ????, Kettle ?????? ?? ?????? ????? ???.

Code Block
cd Kettle
chmod +x *.sh

...



Kitchen ????

Anchor
Launching Kitchen ???? Launching
Kitchen
To launch Kitchen on the different platforms these are the scripts that are provided:
????

?? ????? Carte? ???? ?? ???? ?????? ????.

  • Kitchen.bat: run Kitchen on the Windows platform?? Kitchen? ??.
  • kitchen.sh: run Kitchen on Unix platforms and Mac OSX

Kitchen can be run on any platform that has a version of the Java Runtime Environment version 1.5 or higher.

Command line options

...

  • Unix platform ? Mac OSX?? Kitchen? ??.

Kitchen Java Runtime Environment ?? 1.5 ??? ?? ?? ??, ?? ?????? ?? ? ? ????.

??? ?? ??

Anchor
??? ?? ??
??? ?? ??

?? ? ? ?? ??? ?? ?? ???.
These are the command line options that you can use.

IMPORTANT NOTES:
On Windows system, the use of the minus Windows ??????, ??? ????("-") in the options causes problems as well as the equal sign ? equal("=")? ???? ??? ?? ???. ? ???, 2.2.2 ?? ??? ? ??? ?? ? ? ????.
(Because of this, from version 2.2.2 on, you can also use this format or any combination of /,- and :,=
Fields in italic represent the values that the options use.
It's important that if spaces are present in the option values, you use quotes or double quotes to keep them together. Take a look at the examples below for more info)
????? ??? ??? ?? ??? ???? ?? ?????.
?? ?? ?? ????? ???, ????(quotes or double quotes)? ?????. ??? ??? ??? ??? ???.

Code Block
/option:value

Below are the valid options.

...

??? ??? ??? ???.

?? ??

Code Block
-version

This option displays the version of the Kettle core library ? ??? Kettle? ?? ?????(kettle.jar).
The build version number and build date are shown as well.

...

kar)? ??? ?????.
???? ??? ?? ??? ?? ?????.

XML ?? ??

Code Block
--file=filename

...

XML????

? ??? XML ??? ??? Job? ?????. (.kjb : Kettle Job)

...

???? ??

Code Block
-log=Logging Filename

Specifies the log file. The default is the standard output.

...

???? ??

????? ?? ???. ???? ?? ??(stdout) ???.

???? ??

Code Block
-level=Logging Level

The level option sets the log level for the job that's being run.
These are the possible values:

  • Error: Only show errors
  • Nothing: Don't show any output
  • Minimal: Only use minimal logging
  • Basic: This is the default basic logging level
  • Detailed: Give detailed logging output
  • Debug: For debugging purposes, very detailed output.
  • Rowlevel: Logging at a row level, this can generate a lot of data.

...

????

????? ???? Job? ????? ?? ???.
????? ??? ??? ??? ????:

  • Error: ??? ???.
  • Nothing: ?? ??? ?? ??.
  • Minimal: ???? ??? ???.
  • Basic: ??? ????.
  • Detailed: ??? ????.
  • Debug: ??? ???? ?? ??? ??.
  • Rowlevel: (row)? ??. ? ??? ?? ???? ?? ? ? ????.

??? ??

Code Block
-rep=Repository name

...

?????

?? ?? ??? ??? ?? ???? ?? ???.
??, -user, -pass, -dir and ? -job .
You can also specify this option in the form of environment variable KETTLE_REPOSITORY.

...

??? ??? ??? ???.
???? KETTLE_REPOSITORY ? ? ??? ?? ? ?? ????.

??? ??? ?? ??

Code Block
-user=Username

This is the username with which you want to connect to the repository.
You can also specify this option in the form of environment variable KETTLE_USER.

...

?????

??? ???? ??? ???? ??? ?? ???.
??, ???? KETTLE_USER ? ? ??? ?? ? ?? ????.

??? ???? ??

Code Block
-pass=Password

The password to use to connect to the repository
You can also specify this option in the form of environment variable KETTLE_PASSWORD.

...

????

???? ?????? ???? ????.
???? KETTLE_PASSWORD ? ? ??? ?? ? ?? ????.

?? ? ??? Job? ??

Code Block
-job=Job Name

Use this option to select the job to run from the repository. Please also select the directory with the "-dir" option.

...

??

?? ? Job? ????? ???? ?? ? ??? ?????. "-dir" ???? ????? ?? ? ???.

???? ???? ???

Code Block
-listdir=Y

Print a listing of all the sub-directories in the repository directory specified with the option "-dir" ???? ?? ? ????? ????? ?? ?? ???? ???? ?????.

Set the repository directory

...

If you have set environment variables KETTLE_REPOSITORY, KETTLE_USER, KETTLE_PASSWORD, you can prevent Kitchen from logging into the repository. For example if you want to launch a job from an XML file.

...



??

Anchor
Path ?? Path
??

Please make sure that you are positioned in the Kettle directory before running the samples below. If you put these scripts into a batch file or shell script, simply do a change directory to the installation directory:

...

Code Block
cd /product/Kettle/

Run a job from file

...



...

??? ?? Job ?? ??

Anchor
??? ?? Job ?? ??
??? ?? Job ?? ??

This example runs a job from file on a windows platform:

...

Code Block
kitchen.sh -file=/PRD/updateWarehouse.kjb -level=Minimal

Run a job from Repository

...



...

?????? ?? Job ????

Anchor
?????? ?? Job ????
?????? ?? Job ????

This example runs a job from the repository on a windows platform:
(Enter on a single line without returns...)

Code Block
kitchen.bat
                    /rep:"Production Repository"
                    /job:"Update dimensions"
                    /dir:/Dimensions
                    /user:matt
                    /pass:somepassword123
                    /level:Basic

...



?? ??? ??

Anchor
Redirecting output Redirecting output ?? ??? ??
?? ??? ??

If you don't want the output of the file to appear on the screen but rather be put into a log file, you can use redirection.

...

Code Block
kitchen.bat /file:C:\PRD\runAll.kjb /level:Basic > C:\LOG\trans.log

...



????

Anchor
Return codes Return codes ????
????

Kitchen returns an error code based on how the execution went:

  • 0 : The job ran without a problem.
  • 1 : Errors occurred during processing
  • 2 : An unexpected error occurred during loading / running of the job
  • 7 : The job couldn't be loaded from XML or the Repository
  • 8 : Error loading steps or plugins (error in loading one of the plugins mostly)
  • 9 : Command line usage printing

...



????

Anchor
Scheduling Scheduling ????
????

Schedule a job on windows

...