简体   繁体   English

如何使用oozie工作流程将数据从HDFS复制到本地FS?

[英]How to copy data from HDFS to Local FS using oozie workflow?

I have written the java code using FileUtil.CopyMerge(…) to merge the files into single file. 我已经使用FileUtil.CopyMerge(…)编写了Java代码,以将文件合并为单个文件。

Below is my oozie java action : 以下是我的oozie java操作:

<main-class>Merging</main-class
<arg>${nameNode}/user/abhime01/haadoop/Merge/merge_output</arg>
<arg>file:///home/abhi01/yoooize.txt</arg>

In the above workflow if I try the second arg(destination) as a path in hdfs I am able to merge the data and store in hdfs. 在上述工作流程中,如果我尝试将第二个arg(destination)作为hdfs中的路径,则可以合并数据并将其存储在hdfs中。

But if I give it as path in local file system(as in above snippet) I am getting the following error : 但是,如果我将其作为本地文件系统中的路径提供(如上面的代码段所示),则会出现以下错误:

Mkdirs failed to create file:/home/abhime01 (exists=false, cwd=file:/CDH/sdu1/yarn/nm/usercache/abhime01/appcache/application_1440579785423_1755/container_e27_1440579785423_1755_01_000001) Mkdirs无法创建文件:/ home / abhime01(存在= false,cwd =文件:/ CDH / sdu1 / yarn / nm / usercache / abhime01 / appcache / application_1440579785423_1755 / container_e27_1440579785423_1755_01_000001)

Can anyone please suggest me how to merge files and store it into local FS using ooize. 任何人都可以建议我如何使用ooize合并文件并将其存储到本地FS中。

PS: Java code works fine if it is run without oozie, problem exists while running through oozie. PS:如果在没有oozie的情况下运行Java代码,则可以正常工作,在通过oozie运行时会出现问题。

When you execute actions using Oozie , then the respective actions will get executed by a container in any of random node in the cluster. 当您使用Oozie执行动作时,相应的动作将由集群中任意随机节点中的容器执行。

So the local file path that you mention will be no longer valid for Oozie since its scope is on the cluster. 因此,您提到的本地文件路径将不再适用于Oozie,因为它的作用域在群集上。

So you should not use local file paths as inputs to the any type of Oozie actions , try to bring all dependent inputs and expect the outputs only on HDFS while you use Oozie. 因此,在使用Oozie时,请勿将本地文件路径用作任何类型的Oozie动作的输入,请尝试引入所有相关输入,并期望仅在HDFS上获得输出。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM