kettle的使用

目录

安装

下载路径 百度网盘链接 提取码: 6d7g

下载并解压,解压完成即安装完成。

img_8.png


安装clickhouse驱动包

下载驱动包并解压

img_9.png

将clickhouse-plugins文件夹复制到路径

data-integration ▸ plugins ▸ clickhouse-plugins

其余jar包分别复制到以下路径

data-integration ▸ lib

MacOS系统对应路径

data-integration ▸ libswt ▸ osx64


安装mysql驱动

下载驱动包解压并复制jar包至路径

data-integration ▸ lib

data-integration ▸ libswt ▸ osx64


启动

启动命令行 ./spoon.sh

img_16.png

启动后软件首页

img_18.png


JNDI配置数据源

文件路径 data-integration/simple-jndi/jdbc.properties

ck/type=javax.sql.DataSource
ck/driver=ru.yandex.clickhouse.ClickHouseDriver
ck/url=jdbc:clickhouse://1.2.1.4:8123/dbname?socket_timeout=600000
ck/user=gesaas
ck/password=123456

mysql_test/type=javax.sql.DataSource
mysql_test/driver=com.mysql.cj.jdbc.Driver
mysql_test/url=jdbc:mysql://1.2.1.2:3306/dbname?useUnicode=true&characterEncoding=utf-8
mysql_test/user=root
mysql_test/password=132456

CK数据源配置

img_10.png


mysql数据源配置

img_11.png


转换

新建转换

img_12.png


选择组件定义转换步骤

img_13.png


作业

多个转换组成作业

为作业添加流程

img_14.png


查看作业流程中的转换

img_17.png


一个作业流程例子

img_15.png


crontab定时管理

编写执行脚本文件 /home/data/apps/data-integration/run_job/ip_is_china.sh

. /etc/profile
. ~/.bash_profile
/home/data/apps/data-integration/kitchen.sh -file=/home/data/apps/data-integration/jobs/ip_no_country/ip_no_country.kjb

crontab -e

0 3 * * * sh /home/data/apps/data-integration/run_job/ip_is_china.sh>>/home/data/apps/data-integration/ip_is_china.log