一、DeepOps的ETL小笔记-kettle/pentaho(pdi)简介

说到ETL 是英文Extract-Transform-Load的缩写 ,它是用来描述从数据源端抽取,对其进行转换,然后将数据加载到目标端的一些列过程。

很多系统之间都存在一定的批量数据的交互。然而一个好的ETL工具,在开发和使用维护上可以让我们事半功倍。

目前工作的原因用到的比较多的ETL工具就是Kettle(后期这个改名为pentaho data integration)。下载地址:https://community.hitachivantara.com/s/article/data-integration-kettle

目前最新版本pdi-ce-8.3.0.0-371(虽然页面上显示的是8.2 stable)

kettle 是水壶的意思, 很形象的拟物命名方式,让人感受到,把原料放在水壶里,料理完之后,再将数据倒入目标系统。其他的一些工具也是pan、 kitchen 可视化工具是spoon。

spoon允许通过图形界面来设计ETL转换( transformation )和任务(job)。

pan :批量调用运行transformation。 kitchen 也是一个后台运行的程序

kitchen:批量调用运行job。 kitchen 也是一个后台运行的程序。一般情况使用定时任务启动kitchen去运行job

kettle的文件类型分为两种kjb、ktr。

kjb:就是job,可以用来控制 transformation 的运行流程,可以顺序执行或者并发运行;或者脚本;或者设置变量;传输文件;运行shell等;

ktr:就是transform,转换。具体的数据处理步骤,一般情况包含一个input和一个output。在input和output之间可以执行各式各样的转换操作。

kettle解压之后,配置好与kettle版本匹配的jre环境就可以运行。linux、windows、macos有的还需要根据不同的发行版本,安装一下依赖环境。具体可以参照“ How to get PDI up and running ”,我已经把内容copy了出来。

How to get PDI up and running
Linux
Ubuntu 12.04 and later:
The libwebkitgtk package needs to be installed. This can be done by running apt-get install libwebkitgtk-1.0.0
Unzip the downloaded file. Run spoon.sh file, it should be under /data-integration.
On some installations of Ubuntu 14.04, Unity doesn’t display the menu bar. In order to fix that, spoon.sh has a setting to disable this integration, export UBUNTU_MENUPROXY=0 You can try to remove that setting if you wish to see if it works propery on your machine
CentOS 6 Desktop:
The libwebkitgtk package needs to be installed. This can be done by running yum install libwebkitgtk
Unzip the downloaded file and run spoon.sh, it should be under /data-integration.
Windows
After unzipping the downloaded file, you can launch Spoon by navigating to the folder /data-integration and double clicking Spoon.bat
If you are using Infobright, make sure to copy the following files to your Windows system path (for example %WINDIR%/System32/):
libswt/win32/infobright_jni_64bit.dll (Windows 64-bit)
libswt/win32/infobright_jni.dll (Windows 32-bit)

Rename the file to: infobright_jni.dll, then run Spoon.bat to launch Spoon.
Mac OS
After unzipping the downloaded file, you can launch Spoon by navigating to the folder /data-integration and double clicking on the “Data Integration” application icon.

解压目录下samples文件夹内:transformations、jobs、db里面分别有一些可以参考的例子。

后面我会再一步一步的介绍如何配置一个简单的transformation、job等内容。

Leave a Comment

Your email address will not be published.