在mapreduce任务期间,容器退出时出现非零退出代码1错误

to94eoyn  于 2021-06-02  发布在  Hadoop
关注(0)|答案(1)|浏览(520)

在hadoop中执行jar时,出现以下错误:

16/11/04 18:32:59 INFO mapreduce.Job: Task Id : attempt_1478261728730_0005_m_000000_2, Status : FAILED
Exception from container-launch.
Container id: container_1478261728730_0005_01_000004
Exit code: 1
Stack trace: ExitCodeException exitCode=1: 
    at org.apache.hadoop.util.Shell.runCommand(Shell.java:538)
    at org.apache.hadoop.util.Shell.run(Shell.java:455)
    at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:715)
    at org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor.launchContainer(DefaultContainerExecutor.java:211)
    at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:302)
    at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:82)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

Container exited with a non-zero exit code 1

16/11/04 18:33:09 INFO mapreduce.Job:  map 100% reduce 0%

这是应用程序日志:

Native code library failed to load.
java.lang.UnsatisfiedLinkError: no opencv_java2411 in java.library.pathopencv_java2411

我不知道这是什么意思,有人能帮忙吗?

ljo96ir5

ljo96ir51#

群集节点上缺少opencv。有关如何处理此问题的所有详细信息,请参见此处。
长话短说,您需要在执行器上安装opencv。你真的不能把它编译成你的工作 .jar 因为它是 C 而不是java代码。
更新:注意hadoop执行器上的环境是由hadoop-env.sh设置的。所以它需要包含这样一行: JAVA_LIBRARY_PATH=${JAVA_LIBRARY_PATH}:/etc/opencv/lib

相关问题