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提供了强大的分布式执行能力,是构建企业级数据集成平台的关键组件。
登录后查看全文
热门项目推荐
相关项目推荐
atomcodeClaude Code 的开源替代方案。连接任意大模型,编辑代码,运行命令,自动验证 — 全自动执行。用 Rust 构建,极致性能。 | An open-source alternative to Claude Code. Connect any LLM, edit code, run commands, and verify changes — autonomously. Built in Rust for speed. Get StartedRust099- DDeepSeek-V4-ProDeepSeek-V4-Pro(总参数 1.6 万亿,激活 49B)面向复杂推理和高级编程任务,在代码竞赛、数学推理、Agent 工作流等场景表现优异,性能接近国际前沿闭源模型。Python00
MiMo-V2.5-ProMiMo-V2.5-Pro作为旗舰模型,擅⻓处理复杂Agent任务,单次任务可完成近千次⼯具调⽤与⼗余轮上 下⽂压缩。Python00
GLM-5.1GLM-5.1是智谱迄今最智能的旗舰模型,也是目前全球最强的开源模型。GLM-5.1大大提高了代码能力,在完成长程任务方面提升尤为显著。和此前分钟级交互的模型不同,它能够在一次任务中独立、持续工作超过8小时,期间自主规划、执行、自我进化,最终交付完整的工程级成果。Jinja00
Kimi-K2.6Kimi K2.6 是一款开源的原生多模态智能体模型,在长程编码、编码驱动设计、主动自主执行以及群体任务编排等实用能力方面实现了显著提升。Python00
MiniMax-M2.7MiniMax-M2.7 是我们首个深度参与自身进化过程的模型。M2.7 具备构建复杂智能体应用框架的能力,能够借助智能体团队、复杂技能以及动态工具搜索,完成高度精细的生产力任务。Python00
项目优选
收起
暂无描述
Dockerfile
710
4.51 K
Claude Code 的开源替代方案。连接任意大模型,编辑代码,运行命令,自动验证 — 全自动执行。用 Rust 构建,极致性能。 | An open-source alternative to Claude Code. Connect any LLM, edit code, run commands, and verify changes — autonomously. Built in Rust for speed.
Get Started
Rust
578
99
本项目是CANN提供的数学类基础计算算子库,实现网络在NPU上加速计算。
C++
958
955
deepin linux kernel
C
28
16
🎉 (RuoYi)官方仓库 基于SpringBoot,Spring Security,JWT,Vue3 & Vite、Element Plus 的前后端分离权限管理系统
Vue
1.61 K
942
Ascend Extension for PyTorch
Python
573
694
🍒 Cherry Studio 是一款支持多个 LLM 提供商的桌面客户端
TypeScript
1.43 K
116
openEuler内核是openEuler操作系统的核心,既是系统性能与稳定性的基石,也是连接处理器、设备与服务的桥梁。
C
414
339
暂无简介
Dart
952
235
Nop Platform 2.0是基于可逆计算理论实现的采用面向语言编程范式的新一代低代码开发平台,包含基于全新原理从零开始研发的GraphQL引擎、ORM引擎、工作流引擎、报表引擎、规则引擎、批处理引引擎等完整设计。nop-entropy是它的后端部分,采用java语言实现,可选择集成Spring框架或者Quarkus框架。中小企业可以免费商用
Java
12
2