1. 人人编程首页
  2. Linux知识

linux部署ETL工具kettle

linux部署ETL工具kettle

一.部署准备

查看当前系统版本:

[tower@localhost test]$ uname -a Linux localhost.localdomain 3.10.0-693.el7.x8664 #1 SMP Thu Jul 6 19:56:57 EDT 2017 x8664 x8664 x8664 GNU/Linux [tower@localhost test]$

系统环境:RedHat 7.4 Enterprise Linux 64

1.JDK安装

首先去oracle官网下载安装包:jdk-8u181-linux-x64.tar.gz 然后命令行输入Java -version,查看当前已安装JDK版本,由于安装系统时默认自带openJDK,所以先卸载redhat自带的openjdk。使用命令rpm -qa|grep jdk,找到所有openjdk相关的都移除,使用命令:rpm -e –nodeps 文件名,如下:

rpm -e –nodeps java-1.8.0-openjdk-1.8.0.102-4.b14.el7.x8664
rpm -e –nodeps java-1.8.0-openjdk-headless-1.8.0.102-4.b14.el7.x86
64

在 /usr下新建目录:

mkdir /usr/java

把下载好的JDK安装包放到建好的目录下:

mv jdk-8u181-linux-x64.tar.gz /usr/java/

解压JDK:

tar -zxvf jdk-8u181-linux-x64.tar.gz

2.Java环境变量安装

在命令行输入:

vim /etc/profile

移动光标到最后一行,按下键盘的i键,进入编辑模式,回车,然后输入以下环境变量配置内容:

  1. export JAVA_HOME=/usr/java/jdk1.8.0_131 <br>
  2. export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
  3. export PATH=$PATH:$JAVA_HOME/bin

输入完成后,按键盘上的esc键,退出编辑模式,按住shift键+:键,然后输入wq(保存并退出)。

 执行source命令,重新执行刚修改的初始化文件,使之立即生效,而不必注销并重新登录:

source /etc/profile

最后,测试环境变量是否配置成功,输入 java -version:

  1. [root@localhost tower]# java -version
  2. java version "1.8.0_181"
  3. Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
  4. Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
  5. [root@localhost tower]#

至此,环境配置成功!

二.kettle部署

在kettle官网(现改名为pentaho)https://community.hitachivantara.com/docs/DOC-1009855 下载压缩包pdi-ce-7.1.0.0-12.zip

在/usr下新建目录:

mkdir /usr/kettle

把下载的kettle安装包放到建好的目录下:

mv pdi-ce-7.1.0.0-12.zip /usr/kettle/

用unzip命令解压安装包:

yum install -y unzip unzip pdi-ce-7.1.0.0-12.zip

进入解压目录,找到./kitchen.sh,通过chmod +x *.sh赋予.sh文件执行权限:

chmod +x *.sh

执行./kitchen.sh,查看是否安装成功:

  1. [tower@localhost data-integration]$ ./kitchen.sh
  2. #######################################################################
  3. WARNING:  no libwebkitgtk-1.0 detected, some features will be unavailable
  4.    Consider installing the package with apt-get or yum.
  5.    e.g. 'sudo apt-get install libwebkitgtk-1.0-0'
  6. #######################################################################
  7. Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
  8. Options:
  9.  -rep            = Repository name
  10.  -user           = Repository username
  11.  -pass           = Repository password
  12.  -job            = The name of the job to launch
  13.  -dir            = The directory (dont forget the leading /)
  14.  -file           = The filename (Job XML) to launch
  15.  -level          = The logging level (Basic, Detailed, Debug, Rowlevel, Error, Minimal, Nothing)
  16.  -logfile        = The logging file to write to
  17.  -listdir        = List the directories in the repository
  18.  -listjobs       = List the jobs in the specified directory
  19.  -listrep        = List the available repositories
  20.  -norep          = Do not log into the repository
  21.  -version        = show the version, revision and build date
  22.  -param          = Set a named parameter <NAME>=<VALUE>. For example -param:FILE=customers.csv
  23.  -listparam      = List information concerning the defined parameters in the specified job.
  24.  -export         = Exports all linked resources of the specified job. The argument is the name of a ZIP file.
  25.  -custom         = Set a custom plugin specific option as a String value in the job using <NAME>=<Value>, for example: -custom:COLOR=Red
  26.  -maxloglines    = The maximum number of log lines that are kept internally by Kettle. Set to 0 to keep all rows (default)
  27.  -maxlogtimeout  = The maximum age (in minutes) of a log line while being kept internally by Kettle. Set to 0 to keep all rows indefinitely (default)
  28. [tower@localhost data-integration]$

执行命令后看到如上kettle中的帮助信息,说明kettle部署成功!

调出spoon界面:

在windows系统上面是执行spoon.bat 同理在linux系统上面执行spoon.sh调出spoon的界面进行开发。 执行./spoon.sh,会出现kettle启动界面:

linux篇-部署ETL工具kettle

至此,kettle部署完成

这里说一下,调出spoon界面需要linux客户端支持图形化服务。如果没安装GUI,这个时候就需要用tvnviewer,需要在linux服务端装tvnviewer服务端。

附:远程桌面协议VNC/SPICE/RDP比较 https://blog.csdn.net/u014572278/article/details/54848885

原文始发于微信公众号(编程爱好者社区):linux篇-部署ETL工具kettle

本文来自转载,原文链接:

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注