Parameters after kettle's kitchen. Bat are described as follows:
Kettle is an open-source ETL (extract-transform-load) project. The project name is very interesting. According to Matt, Project Leader, put all kinds of data in a pot and then flow out in a desired format. Kettle includes three major parts:
Spoon -- transform/job design tool (GUI)
Kitchen -- job Executor (command line)
Span -- trasform Executor (command line mode)
Kettle is an open-source ETL Tool written in pure Java. It does not need to be installed in green and data extraction is high.
Stable performance. Kettle has two types of script files: Transformation and Job. Transformation completes basic data conversion, and job controls the entire workflow.
Due to the need for recent work, we have to study the problem of parameters following the call of kitchen. bat.
After a period of research, I finally learned the method of passing parameters.
As follows:
Kitchen. bat can be followed by-or/and then options.
Options:
/REP: Repository name
/User: Repository Username
/Pass: Repository Password
/Job: the name of the job to launch
/DIR: the directory (dont forget the leading /)
/File: the filename (job XML) to launch
/Level: the logging level (basic, detailed, debug, rowlevel, error, nothing)
/Logfile: the logging file to write
/Listdir: list the directories in the repository
/Listjobs: list the jobs in the specified directory
/Listrep: list the available Repositories
/Norep: Do not log into the Repository
/Version: show the version, revision and build date
/Param: Set a named parameter <name >=< value>. For example-Param: Foo = bar
/Listparam: list information concerning the defined parameters in the specified job.
/Export: exports all linked resources of the specified job. The argument is the name of a zip
File.
Options can be followed by =, space, or yes.
Kitchen. BAT/file D: \ or-file = D: \ or/file: D...
For the code for scheduled execution, see [original]. examples can be executed.
1. Execution method in Windows:
Create a MySQL. dat file and write it into it
Cd d:/kettle-3.0.2
Kitchen. BAT/norep-file = D:/kettledata/mysal2orcle. kjb> kitchen _ % Date :~ 0, 10%. Log
Exit
Save the file.
Explain the preceding statements
Cd d:/kettle-3.0.2 means to jump to the kettle root directory, because the kitchen. BAT file is in the root directory.
Kitchen. BAT/norep-file = D:/kettledata/mysal2orcle. kjb> kitchen _ % Date :~ 0, 10%. Log
The above meaning is that kitchen is used. bat command to execute the job file. The storage path of the job file is D:/kettledata/mysal2orcle. kjb and output the execution result to kitchen _ % Date :~ 0, 10%. log file.
2. Writing format in Linux:
Create mysqldb. Sh
The content is as follows:
CD/home/kettle-3.0.2 means to jump to the kettle root directory, because the kitchen. BAT file is in the root directory.
./Kitchen. Sh-file =/home/ETL/MySQL. kjb>/home/ETL/log/kettle. Log
Then the file is executed in crontab.
Note: During shell execution in Linux, because Linux requires strict permissions, kitchen. Sh must have executable permissions. ./, That is,./kitchen. Sh, must be added before execution. Otherwise, the command cannot be found.
How to Use kitchen. BAT:
Kitchen. BAT/file: D: \ job_name.kjb/level: Basic> D: \ ETL. Log
Usage tips:
1. File and level are preceded by '/' and followed by ':'. No one can be lost.
2. This statement must be completed on one line, and there must be no line breaks or the like in the middle.
Several BAT files started debugging by Bo master and slave yesterday, which cannot be recorded in the files I specified, but have been recorded on the DOS interface, by accident, after the BAT file is fully screen, it is found that the original statement is wrapped and can run smoothly after being modified to the same line.
3. this statement cannot be followed by any statement. Even if you add other statements to the BAT file, it will not be executed. After reading a lot of information, you will not find a solution, I can only make a job into a single BAT file. This is a bit of a cup.
4. JDK or JRE is very important.
The blogger suffered a lot because the Java environment was not configured on the server.
Kettle cannot be run because the Java environment is not installed. After the Java environment is installed, the job and conversion can run normally, but kitchen. the bat statement failed to run normally. After reading a bunch of data, I found that it was originally an environment variable problem. After setting the environment variable, it was finally able to run normally.
Example:
Set "ymd = % Date :~, 4% % Date :~ 5, 2% % Date :~ 8, 2% % time :~ 0, 2% % time :~ 3,2% % time :~ 6, 2%"
D:
Cd d: \ Dev \ kettle
Echo execute_time: % ymd %> D: \ Dev \ kettle \ zijinjob \ log.txt
Call kitchen. BAT/norep/file = D: \ Dev \ kettle \ zijinjob \ emp_capital_ri.kjb> D: \ Dev \ kettle \ zijinjob \ log.txt
Note! The following errors may occur during the call process. Check whether the path contains Chinese characters: "error: kitchen can't continue because the job couldn't be loaded"