oozie ssh操作

c9qzyr3d  于 2021-05-30  发布在  Hadoop
关注(0)|答案(2)|浏览(397)

我试图通过oozie工作流运行ssh操作,

<action name="ssh-action">
    <ssh xmlns="uri:oozie:ssh-action:0.1">
        <host>Server name.net<host>
        <command>echo</command>

    </ssh>
    <ok to="endjob"/>
    <error to="endjob"/>
</action>

我将工作流存储到hdfs中,但是当尝试从oozie服务器连接服务器name.net时,我收到以下错误消息,请任何人对此提供帮助,
错误:fnf:/var/tmp/oozie/oozie-dshm46789086433.dir/ssh/ssh.base.sh看起来它与oozie配置有关,请任何人帮助解决这个问题。我的目标是在oozie服务器的特定服务器上运行脚本。

bfnvny8b

bfnvny8b1#

试试这个-
步骤1-创建workflow.xml,如下所示

<?xml version="1.0"?>
<workflow-app xmlns="uri:oozie:workflow:0.3" name="sshAction">
  <start to="MySSHAction"/>
  <action name="MySSHAction">
    <ssh xmlns="uri:oozie:ssh-action:0.1">
      <host>${sshHost}</host>
      <command>${shellScriptPath}</command>
      <capture-output/>
    </ssh>
    <ok to="end"/>
    <error to="fail"/>
  </action>  
  <kill name="fail">
    <message>Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]. </message>
  </kill>
  <end name="end"/>
</workflow-app>

步骤2-配置job.properties

nameNode=hdfs://<namenode-machine>:8020
jobTracker=<resource-manager>:8050
queueName=default
shellScriptPath=/opt/example.sh
sshHost=oozie@localhost

注意-sshhost条目应该是这样的@,并确保可以从oozie@oozie-host 至@
步骤3-编写sample example.sh脚本


# !/bin/bash

echo "Hello Oozie"
tnkciper

tnkciper2#

尝试以下操作:

<action name="shell-action">
        <shell xmlns="uri:oozie:shell-action:0.1">
            <job-tracker>${jobTracker}</job-tracker>
            <name-node>${nameNode}</name-node>
            <configuration>
                <property>
                  <name>mapred.job.queue.name</name>
                  <value>${queueName}</value>
                </property>
            </configuration>
            <exec>example.sh</exec>
        </shell>
        <ok to="end" />
        <error to="kill" />
</action>

相关问题