无法在eclipse中运行TestDistributedShell

时间:2014-01-22 06:27:15

标签: hadoop yarn

我可以在maven中成功运行TestDistributedShell,但在eclipse中失败了。我需要做什么额外的设置吗?

这是我在eclipse中收到的错误消息:

2014-01-22 14:19:49,198 WARN  [AsyncDispatcher event handler] resourcemanager.RMAuditLogger (RMAuditLogger.java:logFailure(255)) - USER=zhangj82    OPERATION=Application Finished - Failed TARGET=RMAppManager RESULT=FAILURE  DESCRIPTION=App failed with state: FAILED   PERMISSIONS=Application application_1390371576457_0001 failed 2 times due to AM Container for appattempt_1390371576457_0001_000002 exited with  exitCode: 127 due to: Exception from container-launch: 
org.apache.hadoop.util.Shell$ExitCodeException: 
    at org.apache.hadoop.util.Shell.runCommand(Shell.java:464)
    at org.apache.hadoop.util.Shell.run(Shell.java:379)
    at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:589)
    at org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor.launchContainer(DefaultContainerExecutor.java:195)
    at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:283)
    at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:1)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:680)

1 个答案:

答案 0 :(得分:2)

我尝试在我的mac上安装hadoop时有同样的异常,我通过在yarn-env.sh和hadoop-env.sh文件中明确定义java home来解决问题

所以转到etc / hadoop并使用显式的java主目录编辑hadoop-env.sh和yarn-env.sh文件。

导出JAVA_HOME = / Library / Java / JavaVirtualMachines / jdk ...

祝你好运!