简体   繁体   English

Oozie-Java:找不到命令-Shell动作

[英]Oozie— java: command not found - shell action

I am running a java program from a shell script through Oozie and I get the below error 我正在通过Oozie从外壳程序脚本运行Java程序,但出现以下错误

java: command not found

When I run the shell script from the edge node I do not find any issues and the java class runs without any error and I get the desired output also. 当我从边缘节点运行shell脚本时,我没有发现任何问题,并且java类运行时没有任何错误,并且我也获得了所需的输出。 However it is the oozie job that fails to run the java command. 但是,是oozie作业无法运行java命令。

All other actions in oozie are executed porperly but when it encounters the java line, it throws the afore said error. oozie中的所有其他动作都将被粗略地执行,但是当遇到java行时,它将引发上述错误。 I understand that all the nodes in the Hadoop cluster will have Java installed, then why do I get this error? 我了解到Hadoop集群中的所有节点都将安装Java,那么为什么会出现此错误? Below is the java command that I have in my shell script 以下是我在Shell脚本中拥有的Java命令

...
...    
java -cp $LOCAL_DIR/libs/integration-tools.jar com.audit.reporting.GenerateExcelReport $LOCAL_DIR/input.txt $LOCAL_DIR/
...

Please provide your thoughts. 请提供您的想法。

"Issue Fixed" “问题已解决”

I talked with my DevOps later and found that the classpath for Java was not set in few datanodes in the Cluster. 后来我与DevOps进行了交谈,发现Java的类路径未在集群中的几个数据节点中设置。 This was stopping the shell action to invoke the JVM at those datanodes. 这正在停止shell动作以在那些数据节点上调用JVM。 After fixing the Classpath, the job ran successfully. 修复类路径后,作业成功运行。 All the comments mentioned by @Charles Duffy are valid. @Charles Duffy提及的所有评论均有效。

Do you have your integration-tools.jar along with your code jar in hdfs location? 您在hdfs位置中是否有您的integration-tools.jar以及代码罐? Oozie can choose any node to run the java action and it will look for these jar at that location. Oozie可以选择任何节点来运行Java操作,它将在该位置查找这些jar。

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

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