使用 OOZIE 将文件从 HDFS 一个目录移动到 HDFS 中的另一个目录?

Move file from HDFS one directory to other directory in HDFS using OOZIE?

我正在尝试将文件从 HDFS 的一个目录复制到 HDFS 中的其他目录,借助 shell 脚本作为 oozie 作业的一部分,但我无法通过 oozie 复制它。

我们可以使用oozie将文件从HDFS的一个目录复制到HDFS中的另一个目录吗?

when i am running the oozie job, i am not any getting error.

it is showing status SUCCEEDED but file is not copying to destination directory.

oozie 文件如下。

test.sh

#!/bin/bash
echo "listing files in the current directory, $PWD"
sudo hadoop fs -cp /user/cloudera/RAVIOOZIE/input/*  /user/cloudera/RAVIOOZIE/output/
ls  # list files

我的workflow.xml是

<workflow-app name="RAMA" xmlns="uri:oozie:workflow:0.5">
<start to="shell-381c"/>
<kill name="Kill">
    <message>Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<action name="shell-381c">
    <shell xmlns="uri:oozie:shell-action:0.1">
        <job-tracker>${jobTracker}</job-tracker>
        <name-node>${nameNode}</name-node>
        <exec>/user/cloudera/test.sh</exec>
        <file>/user/cloudera/test.sh#test.sh</file>
          <capture-output/>
    </shell>
    <ok to="End"/>
    <error to="Kill"/>
</action>
<end name="End"/>

和我的job.properties

oozie.use.system.libpath=True
security_enabled=False
dryrun=True
jobTracker=localhost:8032
nameNode=hdfs://quickstart.cloudera:8020
oozie.wf.application.path=${nameNode}/user/cloudera/test/

请帮忙解决这个问题。为什么文件没有复制到我的目标目录。

请让我知道有什么我遗漏的。

如@Samson 的评论所述:

如果您想使用 oozie 执行 hadoop 操作,您应该使用 hdfs action 而不是 shell 操作。


我不确定您为什么没有收到错误,但这里有一些关于可能发生的情况的推测:

你给oozie一个启动shell动作的任务,它成功启动了shell动作并报告成功。然后 shell 操作失败,但这不是 oozies 问题。