Index
What is Kitchen?
Kitchen is a program that can execute jobs designed by Spoon in XML or in a database repository. Usually jobs are scheduled in batch mode to be run automatically at regular intervals.
Installation
The first step is the installation of Sun Microsystems Java Runtime Environment version 1.5 or higher. You can download a JRE for free athttp://www.java.com/.
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:
Launching Kitchen
To launch Kitchen on the different platforms these are the scripts that are provided:
-
Kitchen.bat: run Kitchen on the Windows platform.
- 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
These are the command line options that you can use.
IMPORTANT NOTES:
On Windows system, the use of the minus ("-") in the options causes problems as well as the equal sign ("="). 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.
Below are the valid options.
Display version information
This option displays the version of the Kettle core library (kettle.jar).
The build version number and build date are shown as well.
Launch XML File
This option runs the job defined in the XML file. (.kjb : Kettle Job)
Set the logging file
Specifies the log file. The default is the standard output.
Set the 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.
Choose a repository
Connect to the repository with name "Repository name".
You also need to specify the options -user, -pass, -dir and -job.
You can also specify this option in the form of environment variable KETTLE_REPOSITORY.
Set the repository user name
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.
Set the repository password
The password to use to connect to the repository
You can also specify this option in the form of environment variable KETTLE_PASSWORD.
Select the repository job to run
Use this option to select the job to run from the repository. Please also select the directory with the "-dir" option.
List the directories in the repository
Print a listing of all the sub-directories in the repository directory specified with the option "-dir".
Set the repository directory
Specifies the directory in the repository to use. Repository directories are specified like this:
- The root directory: /
- A subdirectory: /production/Dimensions
From version 2.2.2 on, a / (slash) is used to separate directories on all platforms.
List the repository jobs
Show a list of all the jobs in the repository directory specified with the option "-dir".
List the available repositories
Print a listing of all the defined repositories.
Don't log in to the repository
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.
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:
If Kettle was installed on windows on the D:\ drive
If Kettle was installed in the /product directory on a Unix system:
Run a job from file
This example runs a job from file on a windows platform:
kitchen.bat /file:D:\Jobs\updateWarehouse.kjb /level:Basic
This example runs a job from file on a Linux box:
kitchen.sh -file=/PRD/updateWarehouse.kjb -level=Minimal
Run a job from Repository
This example runs a job from the repository on a windows platform:
(Enter on a single line without returns...)
kitchen.bat
/rep:"Production Repository"
/job:"Update dimensions"
/dir:/Dimensions
/user:matt
/pass:somepassword123
/level:Basic
例:
kitchen.bat /rep:"ywykettle" /user:admin /pass:admin /job "job_ywy" /dir:/执行job
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.
This example adds the Kitchen output to an ever-growing log file:
kitchen.sh -file="/PRD/updateWarehouse.kjb" --level=Minimal >> /LOG/trans.log
This example writes the Kitchen output to a file that gets overwritten every time:
kitchen.bat /file:C:\PRD\runAll.kjb /level:Basic > C:\LOG\trans.log
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
Scheduling
Schedule a job on windows
The best way to go at it is to test the command first at the dos prompt.
Then you can use the windows scheduler to launch this command.
Windows versions since Windows 2000 have a GUI for doing this accessible through the control panel. However it's also possible to use the command line to do this:
at 23:30 /every:Monday,Wednesday,Friday "D:\updateWarehouse.bat
To see a list of the scheduled commands simply type:
Schedule a job on Unix
First create a shell script that runs all the jobs you need. Then you can schedule this script to run.
On Unix like systems the easiest way to schedule a command is by using the "cron table". You can do this by entering the following command:
Then you can enter the time at which the command needs to be run as well as the command on a single line in the text file that is presented.
The first options are:
- Minute: The minute of the hour, 0-59
- Hour: The hour of the day, 0-23
- Month day: The day of the month, 1-31
- Month: The month of the year, 1-12
- Weekday: The day of the week, 0-6, 0=Sunday
You can specify more then 1 number for each of these values by separating 2 number with a hyphen -. This means an inclusive number range. If you separate the number by commas (,), it means distinct values. If you use * instead of a number, it means: every
possible hour, minute, day, month or weekday.
So, if you want to update the dimensions every hour, at 15 and 45 minutes past the hour during the weekdays, you might enter these lines in a crontab:
#
# Launches the update of the dimensions in the warehouse
# 15,45 * * * 1-5 /PROD/update_dimensions.sh
Kettle定时功能。
<wbr><wbr><wbr>在Job下的start模块,有一个定时功能,可以每日,每周等方式进行定时,对于周期性的ETL,很有帮助。</wbr></wbr></wbr>
<wbr><wbr><wbr>a.使用资源库(repository)登录时,默认的用户名和密码是admin/admin。</wbr></wbr></wbr>
<wbr><wbr><wbr>b.当job是存放在资源库(一般资源库都使用数据库)中时,使用Kitchen.bat执行job时,需使用如下的命令行:<span style="color:#0080C0"><br></span><span style="color:#0080C0">Kitchen.bat /rep kettle /user admin/pass admin /job job名</span></wbr></wbr></wbr>
<wbr><wbr><wbr>c.当job没有存放在资源库而存放在文件系统时,使用Kitchen.bat执行job时,需使用如下的命令行:<span style="color:#0080C0"><br>
Kitchen.bat /norep /file user-transfer-job.kjb</span></wbr></wbr></wbr>
<wbr><wbr><wbr>d.可以使用命令行执行job后,就可以使用windows或linux的任务调度来定时执行任务了</wbr></wbr></wbr>
<wbr><wbr><wbr>e.如果出现异常语句,</wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr><wbr>Unexpected error during transformation metadata load<br><wbr><wbr><wbr><wbr><wbr><wbr>No repository defined!</wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr>请按上面的操作排除。</wbr></wbr></wbr>
分享到:
相关推荐
项目介绍Kettle调度监控平台(以下简称KS)是一个自主开发的javaweb程序,专门用来调度和监控由kettle客户端创建的job和transformation。KS整体的框架是由spring+sprin gmvc +beetlsql整合而成,通过调用kettle的API...
定时调度系统,100%部署成功,有问题联系电话13413011401
kettle定时调度监控方案选型策略 kettle定时调度监控方案选型策略
Kettle根据参数循环调度, 作业名称:总调度-监控数据量 作 者: 鲁班 开发时间:2019.04.03 加载频率:日 加载策略:全量 程序描述:监控数据量
ketlle jar包 下载 下载即用 jar包种类多 方便查找
win7计划任务调度kettle文件,解决kettle自带调度长期占用内存,常常被win7 kill掉
KettlePack是一个基于Kettle9(兼容Kettle8及其他版本)的web端调度监控管理平台,专门用来调度和监控由Kettle客户端创建的Job和Transformation,安装使用简单方便,并拥有完善的帮助文档和在线支持,目前基本可以...
Kettle 功能与产品介绍 Kettle 控件介绍 Kettle 案例演示 Kettle 调度
kettle工具的web 自动调度工程,springMVC
旨在解决企业数据抽取业务场景中,无法通过web方式配置、调度、监控kettle的痛点。通过该项目,开发者可以学习并实践Springboot微服务和前端技术,为后续的大数据调度服务监控平台开发奠定基础。系统界面友好,易于...
kettle调度平台文档
kettle-manager集成web页面调度
整合了Kettle的安装,简单的使用,以及在不同平台的调度配置方法。
将kettle集成值web应用中,不再需打开kettle窗口运行,并通过spring自动任务进行数据抽取,数据库采用数据源(jndi)的方式进行管理。配置简单方便。(之前需要kettle打开其运行环境,并配置数据库连接的相关信息)
Linux下安装kettle,及简单的作业调度
kettle增量同步数据库数据,提醒及windows的后台定时任务,使用windows自带计划管理程序的原因: Kettle自带的定时任务调度不太稳定,而且必须打开Kettle,可以通过windows的任务计划程序调用Kettle的Kitchen.bat来...
参数化配置数据库连接,以及简单shell如何传参调度Kettle
支持并发,单独日志,有问题私聊 可用于:调度任务,参数化使用
使用java调用kettle的jar包,实现同步任务的调度,内含简单的demo
dataCollection项目在kettle基础开发的可视化任务调度系统,提供简单易用的操作界面,降低用户使用crontab调度的学习成本,缩短任务配置时间,避免配置过程中出错