Kettle Linux installation and deployment

1. Install the JDK environment: choose the corresponding version according to your own linux system, for example, my centos7 is x64, so I choose jdk-8u74-linux-x64.tar.gz to download After
downloading , we will move it to the one we created In a directory of the tar package, the directory where the tar package is stored is /usr/local/src/jdk, and then decompress:
tar -zxf /usr/local/src/jdk/jdk-7u65-linux-x64.tar.gz
Edit vi /etc /profile file Add
after the file:
export JAVA_HOME=/usr/local/src/jdk/jdk1.8.0_74
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:$CLASSPATH:${JAVA_HOME}/lib:${ JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH is
executed. After the /etc/profile
configuration is successful, close the terminal, re-enter, enter java –version If there is a version number or something, it proves that the jdk installation is successful

II . Copy the data-integration folder directly to the /usr/local/kettle folder
cd /usr/local/kettle/data-integration Enter this directory and give execute permission
to all .sh files
chmod +x *.sh
Then type ./kitchen.sh in the terminal. If a help message appears, it means the kettle is installed successfully./kitchen.sh
----- run job
           ./span.sh ----- run conversion
1. Create a data file under kettle Folder, used to store conversion and job files
          Create a ktllog folder, used to store log files
          Create a ktlsh folder, used to store script files 1. Create a new file
to execute the job in the ktlsh folder. And give the file execution permission chmod +x xxx.sh Edit xxx.sh file Vi xxx.sh Input: #!/bin/sh source /etc/profile Configure environment variables (when using crontab, because crontab does not recognize system environment variables, So we need to configure it again here) ROOT_TOPDIR=/usr/local/kettle export ROOT_TOPDIR --Set the kettle directory $ROOT_TOPDIR/data-integration/kitchen.sh –file=The file (absolute path) of the job to be executed is saved ! Execute the ./xxx.sh file directly in the ktlsh directory to run

















3. You can directly start ./spoon.sh for visual setting, test database, Hadoop connection
   /root/.kettle/kettle.properties for environment variable assignment

4. Task scheduling
vim /etc/crontab
0 0 * * * root sh /myhome /usr/kettle/ktlsh/jdt_custom.sh >> /myhome/usr/kettle/ktllog/jdtcustomlog

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326689970&siteId=291194637