简体   繁体   English

在没有Oozie的情况下定期运行MapReduce作业?

[英]Running MapReduce job periodically without Oozie?

I have a mapreduce job as a 'jar' ,that should be run daily. 我有一个mapreduce工作作为“罐子”,应该每天运行。 Also, I need to run this jar from a remote java application. 另外,我需要从远程Java应用程序运行此jar。 How can I schedule it: ie, I just want to run job daily from my remote java application. 我该如何安排时间:即,我只想每天从远程Java应用程序运行作业。

I read about Oozie, but I dont think it is apt here. 我读到有关Oozie的信息,但我认为这不适合。

Take a look at Quartz . 看看石英 It enables you to run a standalone java programs or run inside an web or application container (like JBoss or Apache Tomcat). 它使您可以运行独立的Java程序,也可以在Web或应用程序容器(例如JBoss或Apache Tomcat)中运行。 There is a good integration with Spring and Spring batch in particular. 特别是与Spring和Spring批处理之间有很好的集成。

Quartz can be configured outside of the java code - in XML and the syntax is exactly like in crontab. Quartz可以在Java代码之外进行配置-使用XML,其语法与crontab中的语法完全相同。 So, I found it very handy. 因此,我发现它非常方便。

äSome examples can be found here and here . ä可以在此处此处找到一些示例。

I am not clear about your requirement. 我不清楚您的要求。 You can use ssh command execution libraries in your program. 您可以在程序中使用ssh命令执行库。 SSH library for Java If you are running your program in linux environment itself, You can set some crontab for periodic execution. Java的SSH库如果您是在Linux环境中运行程序,则可以设置一些crontab以便定期执行。

If the trigger of your jar is your java program, then you should schedule your java program hourly rather than the jar. 如果jar的触发器是Java程序,那么您应该每小时调度一次Java程序,而不是jar。 And if that is separate, then you can schedule your jar in Oozie workflow where you can have the java code execution in step one of oozie workflow and jar execution in the second step. 如果这是分开的,则可以在Oozie工作流程中安排jar,在oozie工作流程的第一步中可以执行Java代码,在第二步骤中可以执行jar。

In oozie, you can pass the parameters from one level to another as well.Hope this helps. 在oozie中,您也可以将参数从一个级别传递到另一个级别,希望这会有所帮助。

-Dipika Harwani -迪皮卡·哈瓦尼(Dipika Harwani)

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

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