gpt4 book ai didi

hadoop - AWS EMR 4.0 - 如何添加自定义 JAR 步骤以运行 shell 命令

转载 作者:可可西里 更新时间:2023-11-01 14:52:54 26 4
gpt4 key购买 nike

我正在尝试使用 EMR 4.0.0 上的步骤运行 shell 命令,并使用此链接作为引用 - http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/emr-hadoop-script.html

但我想知道从何处将“command-runner.jar”放入“JAR 位置”字段 http://i.stack.imgur.com/CRicz.png

我在 AWS s3 中保留了“command-runner.jar”并尝试从该位置加载它,在“参数”中给出了我的“example.sh”文件的 s3 位置,在添加步骤后它失败并给出了这个异常

Exception in thread "main" java.lang.RuntimeException: java.io.IOException: Cannot run program "s3://<path>/example.sh" (in directory "."): error=2, No such file or directory
at com.amazonaws.emr.command.runner.ProcessRunner.exec(ProcessRunner.java:139)
at com.amazonaws.emr.command.runner.CommandRunner.main(CommandRunner.java:13)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Caused by: java.io.IOException: Cannot run program "s3://<path>/example.sh" (in directory "."): error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
at com.amazonaws.emr.command.runner.ProcessRunner.exec(ProcessRunner.java:92)
... 7 more
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:187)
at java.lang.ProcessImpl.start(ProcessImpl.java:130)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
... 8 more

最佳答案

要运行存储在 S3 中的 shell 脚本,请使用 script-runner.jar,它位于 s3://elasticmapreduce/libs/script-runner/script-runner.jar

command-runner.jar 仅适用于本地文件。

关于hadoop - AWS EMR 4.0 - 如何添加自定义 JAR 步骤以运行 shell 命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34151518/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com