hadoop2.2.0编译

安装依赖包

这些库啊包啊基本都会在编译过程中用到,缺少的话会影响编译,看到error了再找solution非常麻烦,提前装好一劳永逸。$ sudo apt-get install g++ autoconf automake libtool cmake zlib1g-dev pkg-config libssl-dev因为还要用到ssh,所以如果机器上没有的话,装个openssh的客户端就好啦 (ubuntu 12.04应该预装了)$ sudo apt-get install openssh-client当然想装server的话就$ sudo apt-get install openssh-server编译过程中还会用到protobuf 貌似需要最新的2.5.0,因此有低版本的也重新安装一下

安装配置 protobuf

下载最新的protobuf: https://code.google.com/p/protobuf/downloads/list

解压,依次运行$ ./configure --prefix=/usr
$ sudo make
$ sudo make check
$ sudo make install检查一下版本$ protoc --version
libprotoc 2.5.0

编译 hadoop 2.2.0

下载 hadoop 2.2.0  http://www.apache.org/dyn/closer.cgi/hadoop/common/

解压到用户目录 /home/hduser/. 进入 hadoop-2.2.0-src 目录

因为已经安装了maven, protobuf, java环境也有了,compiler也有了所以直接运行

PS:需要打一个patch ,不然后续maven编译会报错

 

[plain] view plaincopyprint?https://code.csdn.net/snippets/108330https://code.csdn.net/snippets/108330/fork

  1. Index: hadoop-common-project/hadoop-auth/pom.xml  
  2. ===================================================================  
  3. --- hadoop-common-project/hadoop-auth/pom.xml   (revision 1543124)  
  4. +++ hadoop-common-project/hadoop-auth/pom.xml   (working copy)  
  5. @@ -54,6 +54,11 @@  
  6.      </dependency>  
  7.      <dependency>  
  8.        <groupId>org.mortbay.jetty</groupId>  
  9. +      <artifactId>jetty-util</artifactId>  
  10. +      <scope>test</scope>  
  11. +    </dependency>  
  12. +    <dependency>  
  13. +      <groupId>org.mortbay.jetty</groupId>  
  14.        <artifactId>jetty</artifactId>  
  15.        <scope>test</scope>  
  16.      </dependency>  
     

patch -p0 < HADOOP-10110.patch

$ mvn package -Pdist,native -DskipTests -Dtar

编译成功如下信息:

INFO] Reactor Summary:
[INFO] 
[INFO] Apache Hadoop Main ................................ SUCCESS [1:20.426s]
[INFO] Apache Hadoop Project POM ......................... SUCCESS [1:27.327s]
[INFO] Apache Hadoop Annotations ......................... SUCCESS [21.654s]
[INFO] Apache Hadoop Assemblies .......................... SUCCESS [0.285s]
[INFO] Apache Hadoop Project Dist POM .................... SUCCESS [39.829s]
[INFO] Apache Hadoop Maven Plugins ....................... SUCCESS [2.954s]
[INFO] Apache Hadoop Auth ................................ SUCCESS [3.318s]
[INFO] Apache Hadoop Auth Examples ....................... SUCCESS [13.679s]
[INFO] Apache Hadoop Common .............................. SUCCESS [2:19.642s]
[INFO] Apache Hadoop NFS ................................. SUCCESS [7.437s]
[INFO] Apache Hadoop Common Project ...................... SUCCESS [0.087s]
[INFO] Apache Hadoop HDFS ................................ SUCCESS [1:54.707s]
[INFO] Apache Hadoop HttpFS .............................. SUCCESS [20.326s]
[INFO] Apache Hadoop HDFS BookKeeper Journal ............. SUCCESS [26.850s]
[INFO] Apache Hadoop HDFS-NFS ............................ SUCCESS [3.585s]
[INFO] Apache Hadoop HDFS Project ........................ SUCCESS [0.046s]
[INFO] hadoop-yarn ....................................... SUCCESS [0.306s]
[INFO] hadoop-yarn-api ................................... SUCCESS [57.532s]
[INFO] hadoop-yarn-common ................................ SUCCESS [19.266s]
[INFO] hadoop-yarn-server ................................ SUCCESS [0.113s]
[INFO] hadoop-yarn-server-common ......................... SUCCESS [4.878s]
[INFO] hadoop-yarn-server-nodemanager .................... SUCCESS [12.777s]
[INFO] hadoop-yarn-server-web-proxy ...................... SUCCESS [1.471s]
[INFO] hadoop-yarn-server-resourcemanager ................ SUCCESS [6.440s]
[INFO] hadoop-yarn-server-tests .......................... SUCCESS [0.702s]
[INFO] hadoop-yarn-client ................................ SUCCESS [2.244s]
[INFO] hadoop-yarn-applications .......................... SUCCESS [0.082s]
[INFO] hadoop-yarn-applications-distributedshell ......... SUCCESS [1.342s]
[INFO] hadoop-mapreduce-client ........................... SUCCESS [0.093s]
[INFO] hadoop-mapreduce-client-core ...................... SUCCESS [13.367s]
[INFO] hadoop-yarn-applications-unmanaged-am-launcher .... SUCCESS [1.322s]
[INFO] hadoop-yarn-site .................................. SUCCESS [0.135s]
[INFO] hadoop-yarn-project ............................... SUCCESS [5.825s]
[INFO] hadoop-mapreduce-client-common .................... SUCCESS [15.695s]
[INFO] hadoop-mapreduce-client-shuffle ................... SUCCESS [1.565s]
[INFO] hadoop-mapreduce-client-app ....................... SUCCESS [5.672s]
[INFO] hadoop-mapreduce-client-hs ........................ SUCCESS [2.463s]
[INFO] hadoop-mapreduce-client-jobclient ................. SUCCESS [4.914s]
[INFO] hadoop-mapreduce-client-hs-plugins ................ SUCCESS [1.164s]
[INFO] Apache Hadoop MapReduce Examples .................. SUCCESS [2.733s]
[INFO] hadoop-mapreduce .................................. SUCCESS [3.664s]
[INFO] Apache Hadoop MapReduce Streaming ................. SUCCESS [2.414s]
[INFO] Apache Hadoop Distributed Copy .................... SUCCESS [27.731s]
[INFO] Apache Hadoop Archives ............................ SUCCESS [1.326s]
[INFO] Apache Hadoop Rumen ............................... SUCCESS [3.011s]
[INFO] Apache Hadoop Gridmix ............................. SUCCESS [2.292s]
[INFO] Apache Hadoop Data Join ........................... SUCCESS [1.296s]
[INFO] Apache Hadoop Extras .............................. SUCCESS [1.919s]
[INFO] Apache Hadoop Pipes ............................... SUCCESS [9.735s]
[INFO] Apache Hadoop Tools Dist .......................... SUCCESS [2.259s]
[INFO] Apache Hadoop Tools ............................... SUCCESS [0.038s]
[INFO] Apache Hadoop Distribution ........................ SUCCESS [31.041s]
[INFO] Apache Hadoop Client .............................. SUCCESS [8.620s]
[INFO] Apache Hadoop Mini-Cluster ........................ SUCCESS [0.213s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13:42.159s
[INFO] Finished at: Wed Jan 22 11:45:52 CST 2014
[INFO] Final Memory: 64M/409M
INFO] Reactor Summary:

在 hadoop-dist/target目录下有如下文件:

root@mgq-Lenovo:/home/mgq/workspace_new/hadoop-2.2.0-src/hadoop-dist/target# ls
antrun                    dist-tar-stitching.sh  hadoop-2.2.0.tar.gz    hadoop-dist-2.2.0-javadoc.jar  maven-archiver
dist-layout-stitching.sh  hadoop-2.2.0           hadoop-dist-2.2.0.jar  javadoc-bundle-options         test-dir

安装配置 hadoop 2.2.0

此时编译好的文件位于 hadoop-2.2.0-src/hadoop-dist/target/hadoop-2.2.0/ 目录中

源码编译成功!开始搞吧

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
经导师精心指导并认可、获 98 分的毕业设计项目!【项目资源】:微信小程序。【项目说明】:聚焦计算机相关专业毕设及实战操练,可作课程设计与期末大作业,含全部源码,能直用于毕设,经严格调试,运行有保障!【项目服务】:有任何使用上的问题,欢迎随时与博主沟通,博主会及时解答。 经导师精心指导并认可、获 98 分的毕业设计项目!【项目资源】:微信小程序。【项目说明】:聚焦计算机相关专业毕设及实战操练,可作课程设计与期末大作业,含全部源码,能直用于毕设,经严格调试,运行有保障!【项目服务】:有任何使用上的问题,欢迎随时与博主沟通,博主会及时解答。 经导师精心指导并认可、获 98 分的毕业设计项目!【项目资源】:微信小程序。【项目说明】:聚焦计算机相关专业毕设及实战操练,可作课程设计与期末大作业,含全部源码,能直用于毕设,经严格调试,运行有保障!【项目服务】:有任何使用上的问题,欢迎随时与博主沟通,博主会及时解答。 经导师精心指导并认可、获 98 分的毕业设计项目!【项目资源】:微信小程序。【项目说明】:聚焦计算机相关专业毕设及实战操练,可作课程设计与期末大作业,含全部源码,能直用于毕设,经严格调试,运行有保障!【项目服务】:有任何使用上的问题,欢迎随时与博主沟通,博主会及时解答。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值