简体   繁体   English

如何通过hue界面将Java Action作为oozie工作流运行

[英]How to run Java Action as oozie workflow with hue interface

I created a test executable jar of a java main method which accepts args[0] = Hadoop . 我创建了一个Java main方法的测试可执行罐,该罐接受args [0] = Hadoop。 The java program takes in this argument and writes the following string in a text file; Java程序接受此参数,并将以下字符串写入文本文件;

"currentTimeStamp /t Welcome to Hadoop!! /n" 100,000 times. “ currentTimeStamp / t欢迎使用Hadoop !! / n” 100,000次。

I used hue interface to create a oozie-workflow for java action. 我使用hue界面为java操作创建了oozie-workflow。 See the workflow.xml below. 请参阅下面的workflow.xml。 The oozie-workflow however executes successfully but the action doesn't create or write in the text file. 但是,oozie-workflow成功执行,但该操作未创建或写入文本文件。 The text file path was /user/ruben123/test.txt. 文本文件路径为/user/ruben123/test.txt。 When I run the jar file in local unix server with command java -jar TestRunner.jar "Hadoop", it executes properly and produces the desired output. 当我使用命令java -jar TestRunner.jar“ Hadoop”在本地unix服务器中运行jar文件时,它会正确执行并产生所需的输出。

I have a single node pseudo cluster running HDP 2.2 as VM provided by Hortonworks. 我有一个由HDR 2.2作为Hortonworks提供的VM运行的单节点伪集群。

<workflow-app name="TestRunner" xmlns="uri:oozie:workflow:0.4">
    <start to="TestRunner"/>
    <action name="TestRunner">
        <java>
            <job-tracker>${jobTracker}</job-tracker>
            <name-node>${nameNode}</name-node>
            <main-class>org.test.TestRunner</main-class>
            <arg>&quot;Hadoop&quot;</arg>
            <capture-output/>
        </java>
        <ok to="end"/>
        <error to="kill"/>
    </action>
    <kill name="kill">
        <message>Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
    </kill>
    <end name="end"/>
</workflow-app>

If you use HUE version 3.8 or 3.9 there is a option under the "Workflows" tab. 如果使用HUE 3.8或3.9版本,则“工作流”选项卡下有一个选项。 You go through this menu "Workflows->Editors->Workflows". 您可以通过此菜单“工作流程->编辑器->工作流程”。

And there you will see an option "Create" in the right corner. 在那里,您会在右上角看到一个“创建”选项。 After you click that button, there will be list of different workflow types (they are all draggable). 单击该按钮后,将出现不同工作流程类型的列表(它们都是可拖动的)。 Drag "Java" workflow and rest should be easy. 拖动“ Java”工作流程,其余工作应该很容易。

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

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