如何在一台服务器上从水壶作业在另一台服务器上运行shell脚本?

时间:2018-06-01 14:24:17

标签: pentaho etl kettle pentaho-spoon pentaho-data-integration

使用Pentaho,我想使用“执行Shell脚本”组件执行位于Kettle Job(.kjb)文件中另一台服务器上的shell脚本。通过在该组件中提供脚本文件名,我成功地在本地运行脚本。但我没有得到如何运行远程脚本。

以下是我简单的kjb的样子: enter image description here

有什么想法吗?

1 个答案:

答案 0 :(得分:1)

使用pentaho作业中的 shell步骤非常简单:

1)在常规选项卡上选中“插入脚本”

2)现在,您可以在“脚本”选项卡上添加此内联脚本:

ssh user@remotemachine 'ls -l'

这将通过ssh

在远程服务器上执行ls -l

确保允许ssh用户使用ssh密钥登录,而不是要求输入密码。