从 windows eclipse 运行 Mapreduce(yarn) 时出错

2023-05-04Java开发问题
3

本文介绍了从 windows eclipse 运行 Mapreduce(yarn) 时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我正在从我的 Eclipse 中运行 WordCount 程序.我尝试使用 Hadoop1.x 运行良好.在 hadoop2.x 上运行时遇到问题

I am running a WordCount program from my eclipse. I tried with Hadoop1.x it is running fine. Facing issue while running on hadoop2.x

我试过了1)将所有 xml 添加到我的类路径中.2)也尝试了conf.set(),在conf对象中设置xml属性.

i tried 1)added all xml into my classpath. 2)also tried conf.set(), setting xml properties in conf object.

还在日志中显示:-没有可用于容器 container_1394042163908_0573_01_000001 的日志

Also in logs it says :-No logs available for container container_1394042163908_0573_01_000001

  Application application_1394042163908_0573 failed 2 times due to AM Container for      appattempt_1394042163908_0573_000002 exited with exitCode: 1 due to: Exception from container-launch:
org.apache.hadoop.util.Shell$ExitCodeException: /bin/bash: line 0: fg: no job control
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(DefaultContainerEx    ecutor.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:79)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)`enter code here`
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
.Failing this attempt.. Failing the application.

推荐答案

我已经解决了这个问题,有一个jira可以解决它:https://issues.apache.org/jira/browse/MAPREDUCE-5655

I have figured out the issue, there is a jira for it:https://issues.apache.org/jira/browse/MAPREDUCE-5655

我刚刚添加了 YARNRunner.java &MRApps.java 到我的项目.它还需要在 windows 框上的 mapred-site.xml 中添加以下属性,以便作业启动器知道作业运行器将是一个 linux:

I just added YARNRunner.java & MRApps.java to my project . It also reqires to add the following property to mapred-site.xml on the windows box, so that the job launcher knows, that the job runner will be a linux:

<property>
<name>mapred.remote.os</name>
<value>Linux</value>
<description>Remote MapReduce framework's OS, can be either Linux or Windows</description>
</property>

而且 MapReduce 现在运行良好.

And MapReduce is running fine now.

同时将 org.apache.hadoop.util.Shell.java 复制到您的项目中.

Also Copy org.apache.hadoop.util.Shell.java into your project.

您可以注释掉下面这行,以消除 winutils.exe 错误.
throw new IOException("在 Hadoop 二进制文件中找不到可执行文件 " + fullExeName + ".");

You can comment out the below line,to remove the winutils.exe Error.
throw new IOException("Could not locate executable " + fullExeName + " in the Hadoop binaries.");

这篇关于从 windows eclipse 运行 Mapreduce(yarn) 时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

如何使用 JAVA 向 COM PORT 发送数据?
How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)...
2024-08-25 Java开发问题
21

如何使报表页面方向更改为“rtl"?
How to make a report page direction to change to quot;rtlquot;?(如何使报表页面方向更改为“rtl?)...
2024-08-25 Java开发问题
19

在 Eclipse 项目中使用西里尔文 .properties 文件
Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)...
2024-08-25 Java开发问题
18

有没有办法在 Java 中检测 RTL 语言?
Is there any way to detect an RTL language in Java?(有没有办法在 Java 中检测 RTL 语言?)...
2024-08-25 Java开发问题
11

如何在 Java 中从 DB 加载资源包消息?
How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)...
2024-08-25 Java开发问题
13

如何更改 Java 中的默认语言环境设置以使其保持一致?
How do I change the default locale settings in Java to make them consistent?(如何更改 Java 中的默认语言环境设置以使其保持一致?)...
2024-08-25 Java开发问题
13