编译hadoop2.0(0.23.0)及运行的一些问题 .

svn co http://svn.apache.org/repos/asf/hadoop/common/tags/release-2.0.0-alpha xxx
  • linux: 参考$HADOOP_HOME/BUILDING.txt 及 $HADOOP_HOME/hadoop-mapreduce-project/INSTALL(ps,我开始没有注意这两个文件,所以我以下都是一步一步调试,纠结,痛苦中写出来了。)  
    1. 装protoc buffer http://protobuf.googlecode.com/files/protobuf-2.4.1.tar.gz
    2. mvn install -Dmaven.skip.test即可。
    3. 产生部署tar包:mvn install -Dtar  -Pdist  -Dmaven.javadoc.skip=true  -DskipTests=true

  • win:
    1. 在win下面,首先下载cygwin:http://www.cygwin.com/ 在path中设置路径。
    2. 下载proto buffer http://code.google.com/p/protobuf/downloads/list如路径:http://code.google.com/p/protobuf/downloads/detail?name=protoc-2.4.1-win32.zip&can=2&q= 解压后把protoc.exe放在cygwin根目录的bin目录下面。
    3. 打上patch:https://issues.apache.org/jira/browse/MAPREDUCE-3881#comment-13478928 就是修改hadoop-mapreduce-project\hadoop-yarn\hadoop-yarn-common\pom.xml:https://issues.apache.org/jira/secure/attachment/12515081/pom.xml.patch
    4. mvn install -Dmaven.skip.test即可。
  • 在eclipse中导入工程,在3.7版本中,出现通过f4找不到ClientRMProtocol的实现类ClientRMService。但是在3.6eclipse中可以。这个比较奇怪,让我不得不用3.6eclipse。
  • mvn install -Dtar  -Pdist -Dmaven.javadoc.skip=true  -Dmaven.test.skip=true打包过程中,出现:
    • [ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.3:single (package-mapreduce) on project hadoop-mapreduce: Assembly is incorrectly configured: hadoop-mapreduce-dist: Assembly is incorrectly configured: hadoop-mapreduce-dist:
      [ERROR] Assembly: hadoop-mapreduce-dist is not configured correctly: Cannot find attachment with classifier: tests in module project: org.apache.hadoop:hadoop-mapreduce-client-jobclient:jar:2.0.0-alpha. Please exclude this module from the module-set.
      此我对hadoop-assemblies工程下的hadoop-mapreduce-dist.xml修改,开始我直接删除了moduleSets导致了,启动yarn报错。后我把tests注释掉了,我现在还不知道这个有啥左右。
    • 补充下,找到原因了。其实就是 -Dmaven.test.skip=true会跳过测试资源编译,这个测试会在maven-assembly-plugin用到。所以报错了。应该该用为-DskipTests=true。
  • hdfs格式化后,启动hdfs后。java.io.IOException: Incompatible clusterIDs in /tmp/hadoop-yarn/dfs/data: namenode clusterID = CID-2917fbbc-dcd7-40f3-8a1f-f222c3941fc1; datanode clusterID = CID-d53b270a-893f-4fa5-b5e5-1e5ed5ee4e86,需要把各个DN下/tmp/hadoop-yarn/dfs/ 下的文件全部删除。
  • 启动yarn 报错。
    • [yarn@hd19-vm1 sbin]$ ./start-yarn.sh
      starting yarn daemons
      starting resourcemanager, logging to /home/yarn/hadoop-2.0.0-alpha/logs/yarn-yarn-resourcemanager-hd19-vm1.yunti.yh.aliyun.com.out
      Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/yarn/server/resourcemanager/ResourceManager
      Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.yarn.server.resourcemanager.ResourceManager
              at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
      这是因为打包少了包的原因,主要是我自定对hadoop-assemblies工程下的hadoop-mapreduce-dist.xml修改的缘故。
  • mr始终在本地运行,因为配置问题,改为yarn的。
    • mapreduce.framework.namelocalThe runtime framework for executing MapReduce jobs.
        Can be one of local, classic or yarn.
        
  • java.lang.IllegalStateException: Invalid shuffle port number -1 returned fo,这个问题我查了很久,主要是yarn对调试比较纠结。
    • Container launch failed for container_1350803453228_0002_01_000004 : java.lang.IllegalStateException: Invalid shuffle port number -1 returned for attempt_1350803453228_0002_r_000000_0
              at org.apache.hadoop.mapreduce.v2.app.launcher.ContainerLauncherImpl$Container.launch(ContainerLauncherImpl.java:162)
              at org.apache.hadoop.mapreduce.v2.app.launcher.ContainerLauncherImpl$EventProcessor.run(ContainerLauncherImpl.java:373)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
              at java.lang.Thread.run(Thread.java:636)
      解决方法其实很简单(框架也不默认下)是因为:yarn.nodemanager.aux-services没有配置mapreduce.shuffle
    • yarn.nodemanager.aux-servicesmapreduce.shuffle

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26276376/viewspace-765353/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/26276376/viewspace-765353/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值