pentaho-kettle 命令行工具详解:Carte 服务器配置与远程执行
2026-02-05 05:03:46作者:侯霆垣
什么是Carte服务器
Carte是Pentaho Data Integration (PDI)的远程服务器组件,提供基于Web的API用于执行和监控转换(Transformation)与作业(Job)。作为数据集成和变换工具的核心服务,它允许用户通过网络接口远程管理数据处理任务,实现分布式数据集成架构。
快速启动Carte服务器
基础启动命令
Carte服务器可以通过命令行快速启动,默认使用8080端口:
./carte.sh
如需指定配置文件启动:
./carte.sh carte-config.xml
启动参数说明
-l:指定日志级别,如-l DEBUG启用调试日志-x:启用XML格式日志输出
配置文件详解
配置文件结构
Carte服务器使用XML格式的配置文件,典型结构如下:
<?xml version="1.0" encoding="UTF-8"?>
<slave_config>
<slaveserver>
<name>Carte-Server</name>
<hostname>localhost</hostname>
<port>8080</port>
<username>admin</username>
<password>password</password>
<master>N</master>
</slaveserver>
<max_log_lines>10000</max_log_lines>
<max_log_timeout_minutes>1440</max_log_timeout_minutes>
<object_timeout_minutes>1440</object_timeout_minutes>
</slave_config>
关键配置参数
| 参数 | 说明 | 默认值 |
|---|---|---|
| name | 服务器名称 | Carte-Server |
| hostname | 主机名或IP地址 | localhost |
| port | 服务端口 | 8080 |
| username | 认证用户名 | admin |
| password | 认证密码 | password |
| max_log_lines | 最大日志行数 | 10000 |
| max_log_timeout_minutes | 日志超时分钟数 | 1440 |
服务器管理API
基础URL与认证
Carte API的基础URL格式为:
http://{hostname}:{port}/kettle
默认情况下使用HTTP Basic认证,可通过curl命令访问:
curl -u username:password "http://localhost:8080/kettle/status?xml=Y"
获取服务器状态
使用以下命令检查Carte服务器运行状态:
# 获取XML格式状态
curl "http://localhost:8080/kettle/status?xml=Y"
# 获取HTML格式状态
curl "http://localhost:8080/kettle/status"
响应内容包含:
- 服务器内存使用情况
- CPU信息
- 运行中的转换和作业
- 系统信息
关闭服务器
通过API优雅关闭Carte服务器:
curl "http://localhost:8080/kettle/stopCarte?xml=Y"
转换(Transformation)管理
注册转换
从仓库或文件系统注册转换:
curl "http://localhost:8080/kettle/registerTrans?name=my-transformation&xml=Y"
执行转换
同步执行
curl "http://localhost:8080/kettle/executeTrans?name=my-transformation&xml=Y"
异步执行
curl "http://localhost:8080/kettle/runTrans?name=my-transformation&xml=Y"
监控转换状态
curl "http://localhost:8080/kettle/transStatus?name=my-transformation&xml=Y"
响应包含:
- 执行状态
- 步骤状态
- 日志信息
- 性能指标
停止转换
curl "http://localhost:8080/kettle/stopTrans?name=my-transformation&xml=Y"
作业(Job)管理
注册作业
curl "http://localhost:8080/kettle/registerJob?name=my-job&xml=Y"
执行作业
# 同步执行
curl "http://localhost:8080/kettle/executeJob?name=my-job&xml=Y"
# 异步执行
curl "http://localhost:8080/kettle/runJob?name=my-job&xml=Y"
监控作业状态
curl "http://localhost:8080/kettle/jobStatus?name=my-job&xml=Y"
实用工具API
获取服务器属性
curl "http://localhost:8080/kettle/properties?xml=Y"
健康检查
简单的健康检查端点:
curl "http://localhost:8080/kettle/status"
如果返回200状态码,表示Carte服务器运行正常。
安全配置
启用认证
在配置文件中设置用户名和密码:
<slaveserver>
<name>slave-server-name</name>
<hostname>localhost</hostname>
<port>8080</port>
<username>admin</username>
<password>password</password>
</slaveserver>
安全最佳实践
- 始终启用认证
- 生产环境使用HTTPS加密传输
- 通过防火墙限制Carte端口访问
- 定期更新密码
- 监控服务器资源使用情况
集群管理
注册从服务器
curl "http://localhost:8080/kettle/registerSlave?xml=Y"
查看从服务器列表
curl "http://localhost:8080/kettle/getSlaves?xml=Y"
故障排除
常见问题解决
- 连接被拒绝:检查Carte是否运行及端口是否可访问
- 认证失败:验证用户名/密码配置
- 转换未找到:确保使用正确名称注册转换
- 内存问题:监控服务器资源并调整JVM设置
启用调试日志
./carte.sh carte-config.xml -l DEBUG
完整工作流示例
以下是一个完整的数据处理任务流程示例:
- 启动Carte服务器
./carte.sh carte-config.xml
- 注册并执行转换
# 注册转换
curl "http://localhost:8080/kettle/registerTrans?name=data-ETL&xml=Y"
# 执行转换
curl "http://localhost:8080/kettle/runTrans?name=data-ETL&xml=Y"
# 检查状态
curl "http://localhost:8080/kettle/transStatus?name=data-ETL&xml=Y"
- 执行后续作业
# 注册作业
curl "http://localhost:8080/kettle/registerJob?name=report-generation&xml=Y"
# 执行作业
curl "http://localhost:8080/kettle/runJob?name=report-generation&xml=Y"
- 查看作业状态
curl "http://localhost:8080/kettle/jobStatus?name=report-generation&xml=Y"
通过这些API和命令,您可以构建自动化的数据集成流程,实现远程、定时、批量的数据处理任务。Carte服务器为pentaho-kettle提供了强大的分布式执行能力,是构建企业级数据集成平台的关键组件。
登录后查看全文
热门项目推荐
相关项目推荐
GLM-5智谱 AI 正式发布 GLM-5,旨在应对复杂系统工程和长时域智能体任务。Jinja00
GLM-5.1GLM-5.1是智谱迄今最智能的旗舰模型,也是目前全球最强的开源模型。GLM-5.1大大提高了代码能力,在完成长程任务方面提升尤为显著。和此前分钟级交互的模型不同,它能够在一次任务中独立、持续工作超过8小时,期间自主规划、执行、自我进化,最终交付完整的工程级成果。Jinja00
MiniMax-M2.7MiniMax-M2.7 是我们首个深度参与自身进化过程的模型。M2.7 具备构建复杂智能体应用框架的能力,能够借助智能体团队、复杂技能以及动态工具搜索,完成高度精细的生产力任务。Python00- QQwen3.5-397B-A17BQwen3.5 实现了重大飞跃,整合了多模态学习、架构效率、强化学习规模以及全球可访问性等方面的突破性进展,旨在为开发者和企业赋予前所未有的能力与效率。Jinja00
HY-Embodied-0.5这是一套专为现实世界具身智能打造的基础模型。该系列模型采用创新的混合Transformer(Mixture-of-Transformers, MoT) 架构,通过潜在令牌实现模态特异性计算,显著提升了细粒度感知能力。Jinja00
LongCat-AudioDiT-1BLongCat-AudioDiT 是一款基于扩散模型的文本转语音(TTS)模型,代表了当前该领域的最高水平(SOTA),它直接在波形潜空间中进行操作。00
项目优选
收起
deepin linux kernel
C
27
14
OpenHarmony documentation | OpenHarmony开发者文档
Dockerfile
659
4.26 K
🎉 (RuoYi)官方仓库 基于SpringBoot,Spring Security,JWT,Vue3 & Vite、Element Plus 的前后端分离权限管理系统
Vue
1.54 K
894
Ascend Extension for PyTorch
Python
504
609
openEuler内核是openEuler操作系统的核心,既是系统性能与稳定性的基石,也是连接处理器、设备与服务的桥梁。
C
391
288
暂无简介
Dart
906
218
🔥LeetCode solutions in any programming language | 多种编程语言实现 LeetCode、《剑指 Offer(第 2 版)》、《程序员面试金典(第 6 版)》题解
Java
69
21
昇腾LLM分布式训练框架
Python
142
168
本项目是CANN提供的数学类基础计算算子库,实现网络在NPU上加速计算。
C++
939
863
🍒 Cherry Studio 是一款支持多个 LLM 提供商的桌面客户端
TypeScript
1.33 K
108