使用http调用Kettle资源库中的ETL任务

这篇文章的基础上是你已经搭建并启动了Carte服务。

我之前是通过pan.sh来执行的ETL任务,但是占用内存比较多,于是考虑使用http来调用。

网上一搜索,要么是收费文章,要么是http调用写的很粗糙,说什么自己定制过,要么就是虽然是使用的http调,但是调用的是自己本地的任务。

我这里记录一下,使用http调用我资源库中的任务,我的资源库是Pentaho repository,但是这个不影响,你其他DB类型的也是同样的XML元素,修改对应内容即可。

1、修改你启动的对应的/opt/ETLDesigner/data-integration/pwd/下的文件,我使用的是/opt/ETLDesigner/data-integration/pwd/carte-config-master-18080.xml,你的路径可能一样,但是最后的那个文件名字可能不同,关注下内容,红色为新增内容:

<slave_config>

<!--

Document description...

  • masters: You can list the slave servers to which this slave has to report back to.

If this is a master, we will contact the other masters to get a list of all the slaves in the cluster.

  • report_to_masters : send a message to the defined masters to let them know we exist (Y/N)

  • slaveserver : specify the slave server details of this carte instance.

IMPORTANT : the username and password specified here are used by the master instances to connect to this slave.

-->

<repository>

<id>PentahoEnterpriseRepository</id>

<name>etl_repositories</name>

<description>Pentaho repository | http://10.2x.x.22:28080/pentaho/Home\</description>

<is_default>true</is_default>

<repository_location_url>http:// 10.2x.x.22: 28080/pentaho</repository_location_url>

<version_comment_mandatory>N</version_comment_mandatory>

<username>admin</username>

<password>xxx@1xx56</password>

</repository>

<slaveserver>

<name>master1</name>

<hostname>10.233.110.22</hostname>

<port>18080</port>

<master>Y</master>

</slaveserver>

</slave_config>

处理好这个文件后,重启Carte服务即可,目的就是为了http调用的时候,让知道从哪个资源库找对应文档。

2、调用KTR

POSTMAN:

GET的URL:http://10.233.110.24:18082/kettle/runTrans/?trans=/public/ODS/ODS_KSHMO_ERP_RCV_TRANSACTIONS_I_D\&rep=etl_repositories\&level=Basic

CURL:

curl --location --request GET 'http://10.233.110.24:18082/kettle/runTrans/?trans=/public/ODS/ODS_KSHMO_ERP_RCV_TRANSACTIONS_I_D\&rep=etl_repositories\&level=Basic' \

--header 'Authorization: Basic Y2x1c3RlcjpjbHVzdGVy'

3、调用KJB

POSTMAN:

GET的URL:http://10.233.110.24:18082/kettle/runJob/?job=/public/TST/TST_JOB_001\&rep=etl_repositories\&level=Basic

CURL:

curl --location --request GET 'http://10.233.110.24:18082/kettle/runJob/?job=/public/TST/TST_JOB_001\&rep=etl_repositories\&level=Basic' \

--header 'Authorization: Basic Y2x1c3RlcjpjbHVzdGVy'

  1. 调用我都亲试了,可以的,访问http://10.233.110.22:18080/kettle/status/获取信息,例如:

后面再尝试其他的。

相关推荐
折哥的程序人生 · 物流技术专研2 天前
Java 23 种设计模式:从踩坑到精通 | 原型模式 —— 克隆对象,深拷贝与浅拷贝的坑你踩过吗?
java·设计模式·架构·原型模式·单一职责原则
ourenjiang3 天前
【学习设计模式】原型模式
学习·设计模式·原型模式
迷藏4945 天前
Python+DuckDB:轻量级BI流水线实战
java·开发语言·python·原型模式
J2虾虾9 天前
Spring AI Alibaba - 检索增强生成(RAG)
人工智能·spring·原型模式
skywalk816311 天前
根据言律的语法,能否用racket进行开发呢?主要探讨是否可行。 racket在这里:E:\Program Files\Racket\Racket.exe
开发语言·原型模式
invicinble13 天前
设计模式(类的拓扑结构)(描述总纲)
设计模式·原型模式
UXbot13 天前
初创公司如何选择合适的UI工具支撑快速迭代产品?
人工智能·低代码·ios·交互·原型模式
之歆14 天前
Day18_JavaScript高级核心:原型链、继承与事件循环机制深度解析(上)
开发语言·javascript·原型模式
看山是山_Lau16 天前
原型模式:当复制比重新创建更高效时
设计模式·原型模式
WHS-_-202219 天前
Millimeter Wave ISAC-SLAM: Framework and RFSoC Prototype
人工智能·算法·原型模式