如何在oozie中指定多个jar文件 [英] How to specify multiple jar files in oozie
问题描述
我需要一个针对以下问题的解决方案:
我的项目有两个罐子,其中一个jar包含所有bean类,比如Employee等,其他jar包含使用第一个jar bean类的MR作业,所以当iam试图运行MR作为一个简单的java程序时,我面临的类未找到问题(com.abc.Employee类未找到,因为它在另一个jar )所以任何人都可以为我提供解决方案,如何解决问题....实时可能会有很多罐子不是1或2如何指定所有这些罐子,任何人都可以尽快回复。
您应该在存储您的HDFS目录中有一个 lib
Oozie工作流程。您可以将两个jar文件放在这个文件夹中,并且oozie将确保当您的MR作业执行时两者都在类路径中:
hdfs: //namenode:8020/path/to/oozie/app/workflow.xml
hdfs:// namenode:8020 / path / to / oozie / app / lib / first.jar
hdfs:// namenode:8020 / path / to / oozie / app / lib / second.jar
请参阅工作流应用程序部署了解更多详情
如果您经常在多个oozie工作流程中使用jar,您可以将这些常见jar(例如HBase jar)放在HDFS的目录中,然后在oozie属性中表示包含此文件夹的jar。 href =http://oozie.apache.org/docs/3.3.2/WorkflowFunctionalSpec.html#a17_HDFS_Share_Libraries_for_Workflow_Applications_since_Oozie_2.3 =nofollow> HDFS共享库了解更多详情
I need a solution for the following problem: My project has two jars in which
one jar contains all bean classes like Employee etc, and the other jar contains MR jobs which uses the first jar bean class so when iam trying to run the MR job as a simple java program i am facing the issue of class not found (com.abc.Employee class not found as it is in another jar) so can any one provide me the solution how to solve the issue .... as in real time there may be many jars not 1 or 2 how to specify all those jars can any one please reply as soon as possible.
You should have a lib
folder in the HDFS directory where you are storing your Oozie workflow. You can place both jar files in this folder and oozie will ensure both are on the classpath when your MR job executes:
hdfs://namenode:8020/path/to/oozie/app/workflow.xml
hdfs://namenode:8020/path/to/oozie/app/lib/first.jar
hdfs://namenode:8020/path/to/oozie/app/lib/second.jar
See Workflow Application Deployment for more details
If you often use jars in a number of oozie workflows, you can place these common jars (HBase jars for example) in a directory in HDFS, and then denote in an oozie property to include this folder's jars See HDFS Share Libraries for more details
这篇关于如何在oozie中指定多个jar文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!