主要描述下,在Win7环境下,通过eclipse往集群提交MapReduce程序的过程。
一、环境说明:
开发环境:WIN7
Eclipse版本:eclipse-jee-indigo
Hadoop版本:Hadoop2.5.2
MR运行模式:Yarn
二、使用MapReduce的Eclipse插件:
插件名称:hadoop-eclipse-plugin-2.5.2.jar
可以网上下载,本文档附件中也有上传。
将插件复制到${ECLIPSE_HOME}/plugins/目录下。
三、运行简单的MR(如:Wordcount)程序,碰到下面问题:
1、运行测试程序时,会出现以下报错:
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:702)
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:300)
at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:81)
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
解决方法:
需要在yarn-site.xml上,配置以下内容:
<property>
<name>mapreduce.job.ubertask.enable</name>
<value>true</value>
</property>
当在WIN7下用Eclipse提交MR程序时,如果还报这样的错误,需要在客户端代码增加如下配置:
conf.set("mapreduce.job.ubertask.enable","true");
2、运行测试程序时,会出现以下报错:
ExitCodeException exitCode=1: /bin/bash: line 0: fg: no job control
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:702)
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:300)
at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:81)
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
.Failing this attempt.. Failing the application.
解决方法:
conf.set("mapreduce.app-submission.cross-platform", "true");
或:
conf.setBoolean("mapreduce.app-submission.cross-platform", true);
3、正常情况下,在Win7下通过Eclipse向集群提交运行程序时,MapReduce的Main方法需要增加以下配置项:
conf.set("fs.default.name", "hdfs://xxx.xxx.xxx.xxx:8020");
conf.set("yarn.resourcemanager.address", "xxx.xxx.xxx.xxx:8032");
conf.set("yarn.resourcemanager.scheduler.address", "xxx.xxx.xxx.xxx:8030");
conf.set("mapreduce.jobhistory.address", "xxx.xxx.xxx.xxx:10020");
conf.set("mapreduce.framework.name", "yarn");
conf.setBoolean("mapreduce.app-submission.cross-platform", true);
conf.setBoolean("mapreduce.job.ubertask.enable", true);
相关推荐
在Windows7 x64 + Eclipse + Hadoop 2.5.2搭建MapReduce开发环境,下载的文件中包括下载的文件包括:hadoop 2.5.2.tar.gz,hadoop-common-2.2.0-bin-master.zip,hadoop-eclipse-plugin-2.5.2.jar。应用这些软件的...
hadoop2.5.2开发所用到的基础jar包,本人亲测
本人亲手操作搭建Hadoop集群成功,并通过Eclipse进行MapReduce程序的开发,步骤详细完整,在相关过程中配有完整代码和解释,全程无误,只需复制粘贴即可,小白新手按步骤一步一步来也能搭建Hadoop集群成功并进行...
本文针对Hadoop2.5.2的集群安装过程进行详细的讲解,根据本文可顺利完成Hadoop集群的安装和基本使用。
hadoop2.5.2在windows下搭建开发环境并进行测试可以运行。
搭建了一个完全分布式Hadoop集群,并通过Java写了mapreduce程序处理数据,需要下载的可以找我要具体数据。
hadoop2.5.2 + eclipse + win32位环境安装及开发环境搭建全套资源及说明 Hi:发帖目的是因为Hadoop开发环境搭建太麻烦了,涉及很多版本和工具组件的问题,自己也走了不少弯路,把资源集中一下,让大家少走弯路,也...
hadoop 2.5.2 64位native包
eclipse环境下集成hadoop2.5.2时候需要的jar包 ant已经编译好了的可以直接用
Hadoop集群配置及MapReduce开发手册
window下eclipse中运行mapreduce程序所需要的Hadoop全部jar包
Map-Reduce原理体系架构和工作机制,eclipse与Hadoop集群连接
文件是hadoop 2.5.2源码,从官方网站下载的,供国内访问不正常的同学下载
(1)熟悉Hadoop开发包 (2)编写MepReduce程序 (3)调试和运行MepReduce程序 (4)完成上课老师演示的内容 二、实验环境 Windows 10 VMware Workstation Pro虚拟机 Hadoop环境 Jdk1.8 二、实验内容 1.单词计数实验...
hadoop-eclipse2.5.2、hadoop-eclipse2.6.0、hadoop-eclipse2.6.5
windows下配置cygwin、hadoop等并运行mapreduce及mapreduce程序讲解
hadoop-2.5.2.tar.gz
有详细的Hadoop集群配置说明,另外还讲解了mapreduce开发和Hadoop性能优化。
从0开始一步一步安装和部署Hadoop 2.5.2