CentOS6.5上编译安装Hadoop2

分类:CentOS教程 阅读:60652 次

CentOS6.5上编译安装Hadoop2

环境

操作系统:CentOS_6.5_64bit

[root@master conf]# cat /proc/version; lsb_release -a Linux version 2.6.32-431.5.1.el6.x86_64 (mockbuild@c6b10.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC) ) #1 SMP Wed Feb 12 00:41:43 UTC 2014 LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch Distributor ID: CentOS Description: CentOS release 6.5 (Final) Release: 6.5 Codename: Final

编译Hadoop版本:hadoop-2.2.0

准备

[root@master ~]# yum -y install java-1.7.0-openjdk java-1.7.0-openjdk-devel ldapjdk

 [root@master ~]# ll /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.51.x86_64/ 总用量 216 -r--r--r-- 1 root root 1503 1月 14 20:59 ASSEMBLY_EXCEPTION drwxr-xr-x 2 root root 4096 3月 11 03:33 bin drwxr-xr-x 3 root root 4096 3月 11 03:33 include drwxr-xr-x 4 root root 4096 3月 11 03:33 jre drwxr-xr-x 3 root root 4096 3月 11 03:33 lib -r--r--r-- 1 root root 19263 1月 14 20:59 LICENSE drwxr-xr-x 2 root root 4096 3月 11 03:33 tapset -r--r--r-- 1 root root 172252 1月 14 20:59 THIRD_PARTY_README
查看java版本。
 [root@master ~]# java -version java version "1.7.0_51" OpenJDK Runtime Environment (rhel-2.4.4.1.el6_5-x86_64 u51-b02) OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)

2. 安装maven(官方网站地址:http://maven.apache.org/)

Apache Maven,是一个软件(特别是Java软件)项目管理及自动构建工具,由Apache软件基金会所提供。基于项目对象模型(缩写:POM)概念,Maven利用一个中央信息片断能管理一个项目的构建、报告和文档等步骤。曾是Jakarta项目的子项目,现为独立Apache项目。

yum安装maven

[root@master maven]# yum install apache-maven.noarch 查看maven版本

[root@master maven]# mvn -version Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T12:37:52-05:00) Maven home: /usr/share/apache-maven Java version: 1.7.0_51, vendor: Oracle Corporation Java home: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.51.x86_64/jre Default locale: zh_CN, platform encoding: UTF-8 OS name: "linux", version: "2.6.32-431.5.1.el6.x86_64", arch: "amd64", family: "unix"

下载安装maven(下载地址:http://maven.apache.org/download.cgi)apache-maven-3.2.1-bin.tar.gz

解压

[root@master~]#tar-zxvfapache-maven-3.2.1-bin.tar.gz

[root@master ~]# tar -zxvf apache-maven-3.2.1-bin.tar.gz

 [root@master ~]# cd apache-maven-3.2.1 [root@master apache-maven-3.2.1]# ll 总用量 40 drwxr-xr-x 2 root root 4096 3月 18 02:23 bin drwxr-xr-x 2 root root 4096 3月 18 02:23 boot drwxr-xr-x 3 root root 4096 2月 14 12:34 conf drwxr-xr-x 3 root root 4096 3月 18 02:23 lib -rw-r--r-- 1 root root 14865 2月 14 12:40 LICENSE -rw-r--r-- 1 root root 182 2月 14 12:39 NOTICE -rw-r--r-- 1 root root 2513 2月 14 12:34 README.txt

[root@master~]#cp-rapache-maven-3.2.1/usr/local/

[root@master ~]# cp -r apache-maven-3.2.1 /usr/local/ [root@master ~]# cd /usr/local/apache-maven-3.2.1/ [root@master apache-maven-3.2.1]# ll 总用量 40 drwxr-xr-x 2 root root 4096 3月 18 02:24 bin drwxr-xr-x 2 root root 4096 3月 18 02:24 boot drwxr-xr-x 3 root root 4096 3月 18 02:24 conf drwxr-xr-x 3 root root 4096 3月 18 02:24 lib -rw-r--r-- 1 root root 14865 3月 18 02:24 LICENSE -rw-r--r-- 1 root root 182 3月 18 02:24 NOTICE -rw-r--r-- 1 root root 2513 3月 18 02:24 README.txt [root@master apache-maven-3.2.1]# 将MAVEN_HOME加入环境变量中。

[root@masterapache-maven-3.2.1]#vim/etc/profile

[root@master apache-maven-3.2.1]# vim /etc/profile

在/etc/profile的最后一行加入如下。

export MAVEN_HOME=/usr/local/apache-maven-3.2.1 export PATH=.:$MAVEN_HOME/bin:$PATH 保存退出。

更新并查看maven版本。

  1. [root@masterapache-maven-3.2.1]#source/etc/profile
  2. [root@masterapache-maven-3.2.1]#mvn--version
  3. ApacheMaven3.2.1(ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9;2014-02-14T12:37:52-05:00)
  4. Mavenhome:/usr/local/apache-maven-3.2.1
  5. Javaversion:1.7.0_51,vendor:OracleCorporation
  6. Javahome:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.51.x86_64/jre
  7. Defaultlocale:zh_CN,platformencoding:UTF-8
  8. OSname:"linux",version:"2.6.32-431.5.1.el6.x86_64",arch:"amd64",family:"unix"

[root@master apache-maven-3.2.1]# source /etc/profile [root@master apache-maven-3.2.1]# mvn --version Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T12:37:52-05:00) Maven home: /usr/local/apache-maven-3.2.1 Java version: 1.7.0_51, vendor: Oracle Corporation Java home: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.51.x86_64/jre Default locale: zh_CN, platform encoding: UTF-8 OS name: "linux", version: "2.6.32-431.5.1.el6.x86_64", arch: "amd64", family: "unix"

3. 安装protobuf(官方网站地址:https://code.google.com/p/protobuf/)

  1. [root@master~]#yuminstallgccgcc-c++make

[root@master ~]# yum install gcc gcc-c++ make

  1. [root@master~]#tar-zxvfprotobuf-2.5.0.tar.gz
  2. [root@master~]#cdprotobuf-2.5.0
  3. [root@masterprotobuf-2.5.0]#ll
  4. 总用量1212
  5. -rw-r--r--11099655000369762月262013aclocal.m4
  6. -rwxr-xr--1109965500015192月262013autogen.sh
  7. -rw-r--r--11099655000253122月262013CHANGES.txt
  8. -rwxr-xr--11099655000448262月262013config.guess
  9. -rw-r--r--1109965500037092月262013config.h.in
  10. -rwxr-xr--11099655000354542月262013config.sub
  11. -rwxr-xr--110996550005991502月262013configure
  12. -rw-r--r--1109965500048292月262013configure.ac
  13. -rw-r--r--1109965500035272月262013CONTRIBUTORS.txt
  14. -rw-r--r--1109965500017322月262013COPYING.txt
  15. -rwxr-xr--11099655000203342月262013depcomp
  16. drwxr-xr-x2109965500040962月262013editors
  17. drwxr-xr-x2109965500040962月262013examples
  18. -rwxr-xr--1109965500011052月262013generate_descriptor_proto.sh
  19. drwxr-xr-x15109965500040962月262013gtest
  20. -rwxr-xr--11099655000139982月262013install-sh
  21. -rw-r--r--1109965500095372月262013INSTALL.txt
  22. drwxr-xr-x3109965500040962月262013java
  23. -rw-r--r--110996550002836802月262013ltmain.sh
  24. drwxr-xr-x2109965500040962月262013m4
  25. -rw-r--r--11099655000151892月262013Makefile.am
  26. -rw-r--r--11099655000417422月262013Makefile.in
  27. -rwxr-xr--11099655000103462月262013missing
  28. -rw-r--r--110996550004082月262013protobuf-lite.pc.in
  29. -rw-r--r--110996550004292月262013protobuf.pc.in
  30. drwxr-xr-x3109965500040962月262013python
  31. -rw-r--r--1109965500053122月262013README.txt
  32. drwxr-xr-x4109965500040962月262013src
  33. drwxr-xr-x2109965500040962月262013vsprojects
  34. [root@masterprotobuf-2.5.0]#./configure--prefix=/usr/local/protoc/
  35. [root@masterprotobuf-2.5.0]#make&&makeinstall
 [root@master ~]# tar -zxvf protobuf-2.5.0.tar.gz [root@master ~]# cd protobuf-2.5.0 [root@master protobuf-2.5.0]# ll 总用量 1212 -rw-r--r-- 1 109965 5000 36976 2月 26 2013 aclocal.m4 -rwxr-xr-- 1 109965 5000 1519 2月 26 2013 autogen.sh -rw-r--r-- 1 109965 5000 25312 2月 26 2013 CHANGES.txt -rwxr-xr-- 1 109965 5000 44826 2月 26 2013 config.guess -rw-r--r-- 1 109965 5000 3709 2月 26 2013 config.h.in -rwxr-xr-- 1 109965 5000 35454 2月 26 2013 config.sub -rwxr-xr-- 1 109965 5000 599150 2月 26 2013 configure -rw-r--r-- 1 109965 5000 4829 2月 26 2013 configure.ac -rw-r--r-- 1 109965 5000 3527 2月 26 2013 CONTRIBUTORS.txt -rw-r--r-- 1 109965 5000 1732 2月 26 2013 COPYING.txt -rwxr-xr-- 1 109965 5000 20334 2月 26 2013 depcomp drwxr-xr-x 2 109965 5000 4096 2月 26 2013 editors drwxr-xr-x 2 109965 5000 4096 2月 26 2013 examples -rwxr-xr-- 1 109965 5000 1105 2月 26 2013 generate_descriptor_proto.sh drwxr-xr-x 15 109965 5000 4096 2月 26 2013 gtest -rwxr-xr-- 1 109965 5000 13998 2月 26 2013 install-sh -rw-r--r-- 1 109965 5000 9537 2月 26 2013 INSTALL.txt drwxr-xr-x 3 109965 5000 4096 2月 26 2013 java -rw-r--r-- 1 109965 5000 283680 2月 26 2013 ltmain.sh drwxr-xr-x 2 109965 5000 4096 2月 26 2013 m4 -rw-r--r-- 1 109965 5000 15189 2月 26 2013 Makefile.am -rw-r--r-- 1 109965 5000 41742 2月 26 2013 Makefile.in -rwxr-xr-- 1 109965 5000 10346 2月 26 2013 missing -rw-r--r-- 1 109965 5000 408 2月 26 2013 protobuf-lite.pc.in -rw-r--r-- 1 109965 5000 429 2月 26 2013 protobuf.pc.in drwxr-xr-x 3 109965 5000 4096 2月 26 2013 python -rw-r--r-- 1 109965 5000 5312 2月 26 2013 README.txt drwxr-xr-x 4 109965 5000 4096 2月 26 2013 src drwxr-xr-x 2 109965 5000 4096 2月 26 2013 vsprojects [root@master protobuf-2.5.0]# ./configure --prefix=/usr/local/protoc/ [root@master protobuf-2.5.0]# make && make install

安装完成后,将protoc写入环境变量。
  1. [root@masterprotobuf-2.5.0]#vim/etc/profile
 [root@master protobuf-2.5.0]# vim /etc/profile
  1. exportPROTOC_HOME=/usr/local/protoc
  2. exportPATH=.:$PROTOC_HOME/bin:$PATH
 export PROTOC_HOME=/usr/local/protoc export PATH=.:$PROTOC_HOME/bin:$PATH
更新并查看protobuf版本。
  1. [root@masterprotobuf-2.5.0]#source/etc/profile
  2. [root@masterprotobuf-2.5.0]#protoc--version
  3. libprotoc2.5.0
 [root@master protobuf-2.5.0]# source /etc/profile [root@master protobuf-2.5.0]# protoc --version libprotoc 2.5.0

4. 安装其他依赖

  1. [root@masterprotobuf-2.5.0]#yuminstallcmakeopenssl-develncurses-devel<SPANstyle="FONT-SIZE:18px">
  2. </SPAN>

[root@master protobuf-2.5.0]# yum install cmake openssl-devel ncurses-devel

编译安装

  1. [root@masterhadoop]#tar-zxvfhadoop-2.2.0-src.tar.gz

[root@master hadoop]# tar -zxvf hadoop-2.2.0-src.tar.gz

  1. [root@masterhadoop]#cdhadoop-2.2.0-src
  2. root@masterhadoop-2.2.0-src]#ll
  3. 总用量108
  4. -rw-r--r--167974users996810月701:53BUILDING.txt
  5. drwxr-xr-x267974users409610月702:45dev-support
  6. drwxr-xr-x367974users409610月702:45hadoop-assemblies
  7. drwxr-xr-x267974users409610月702:45hadoop-client
  8. drwxr-xr-x867974users409610月702:45hadoop-common-project
  9. drwxr-xr-x267974users409610月702:45hadoop-dist
  10. drwxr-xr-x667974users409610月702:45hadoop-hdfs-project
  11. drwxr-xr-x1067974users409610月702:45hadoop-mapreduce-project
  12. drwxr-xr-x367974users409610月702:45hadoop-maven-plugins
 [root@master hadoop]# cd hadoop-2.2.0-src root@master hadoop-2.2.0-src]# ll 总用量 108 -rw-r--r-- 1 67974 users 9968 10月 7 01:53 BUILDING.txt drwxr-xr-x 2 67974 users 4096 10月 7 02:45 dev-support drwxr-xr-x 3 67974 users 4096 10月 7 02:45 hadoop-assemblies drwxr-xr-x 2 67974 users 4096 10月 7 02:45 hadoop-client drwxr-xr-x 8 67974 users 4096 10月 7 02:45 hadoop-common-project drwxr-xr-x 2 67974 users 4096 10月 7 02:45 hadoop-dist drwxr-xr-x 6 67974 users 4096 10月 7 02:45 hadoop-hdfs-project drwxr-xr-x 10 67974 users 4096 10月 7 02:45 hadoop-mapreduce-project drwxr-xr-x 3 67974 users 4096 10月 7 02:45 hadoop-maven-plugins
  1. [root@masterhadoop-2.2.0-src]#cdhadoop-common-project/hadoop-auth
  2. [root@masterhadoop-auth]#ll
  3. 总用量20
  4. -rw-r--r--167974users62910月701:52BUILDING.txt
  5. -rw-r--r--167974users702810月701:52pom.xml
  6. -rw-r--r--167974users54510月701:52README.txt
  7. drwxr-xr-x567974users409610月701:52src
  8. [root@masterhadoop-auth]#vimpom.xml
 [root@master hadoop-2.2.0-src]# cd hadoop-common-project/hadoop-auth [root@master hadoop-auth]# ll 总用量 20 -rw-r--r-- 1 67974 users 629 10月 7 01:52 BUILDING.txt -rw-r--r-- 1 67974 users 7028 10月 7 01:52 pom.xml -rw-r--r-- 1 67974 users 545 10月 7 01:52 README.txt drwxr-xr-x 5 67974 users 4096 10月 7 01:52 src [root@master hadoop-auth]# vim pom.xml 
  1. <dependency>
  2. <groupId>org.mortbay.jetty</groupId>
  3. <artifactId>jetty-util</artifactId>
  4. <scope>test</scope>
  5. </dependency>
 <dependency> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-util</artifactId> <scope>test</scope> </dependency>
  1. [root@masterhadoop-auth]#cd../../
  2. [root@masterhadoop-2.2.0-src]#ll
  3. 总用量108
  4. -rw-r--r--167974users996810月701:53BUILDING.txt
  5. drwxr-xr-x267974users409610月702:45dev-support
  6. drwxr-xr-x367974users409610月702:45hadoop-assemblies
  7. drwxr-xr-x267974users409610月702:45hadoop-client
  8. drwxr-xr-x867974users409610月702:45hadoop-common-project
  9. drwxr-xr-x267974users409610月702:45hadoop-dist
  10. drwxr-xr-x667974users409610月702:45hadoop-hdfs-project
  11. drwxr-xr-x1067974users409610月702:45hadoop-mapreduce-project
  12. drwxr-xr-x367974users409610月702:45hadoop-maven-plugins
  13. drwxr-xr-x267974users409610月702:45hadoop-minicluster
  14. drwxr-xr-x367974users409610月702:45hadoop-project
  15. drwxr-xr-x267974users409610月702:45hadoop-project-dist
  16. drwxr-xr-x1167974users409610月702:45hadoop-tools
  17. drwxr-xr-x367974users409610月702:45hadoop-yarn-project
  18. -rw-r--r--167974users1516410月702:46LICENSE.txt
  19. -rw-r--r--167974users10110月702:46NOTICE.txt
  20. -rw-r--r--167974users1656910月701:53pom.xml
  21. -rw-r--r--167974users136610月702:46README.txt
 [root@master hadoop-auth]# cd ../../ [root@master hadoop-2.2.0-src]# ll 总用量 108 -rw-r--r-- 1 67974 users 9968 10月 7 01:53 BUILDING.txt drwxr-xr-x 2 67974 users 4096 10月 7 02:45 dev-support drwxr-xr-x 3 67974 users 4096 10月 7 02:45 hadoop-assemblies drwxr-xr-x 2 67974 users 4096 10月 7 02:45 hadoop-client drwxr-xr-x 8 67974 users 4096 10月 7 02:45 hadoop-common-project drwxr-xr-x 2 67974 users 4096 10月 7 02:45 hadoop-dist drwxr-xr-x 6 67974 users 4096 10月 7 02:45 hadoop-hdfs-project drwxr-xr-x 10 67974 users 4096 10月 7 02:45 hadoop-mapreduce-project drwxr-xr-x 3 67974 users 4096 10月 7 02:45 hadoop-maven-plugins drwxr-xr-x 2 67974 users 4096 10月 7 02:45 hadoop-minicluster drwxr-xr-x 3 67974 users 4096 10月 7 02:45 hadoop-project drwxr-xr-x 2 67974 users 4096 10月 7 02:45 hadoop-project-dist drwxr-xr-x 11 67974 users 4096 10月 7 02:45 hadoop-tools drwxr-xr-x 3 67974 users 4096 10月 7 02:45 hadoop-yarn-project -rw-r--r-- 1 67974 users 15164 10月 7 02:46 LICENSE.txt -rw-r--r-- 1 67974 users 101 10月 7 02:46 NOTICE.txt -rw-r--r-- 1 67974 users 16569 10月 7 01:53 pom.xml -rw-r--r-- 1 67974 users 1366 10月 7 02:46 README.txt
  1. [root@masterhadoop-2.2.0-src]#mvnpackage-DskipTests-Pdist,native
 [root@master hadoop-2.2.0-src]# mvn package -DskipTests -Pdist,native
  1. [INFO]------------------------------------------------------------------------
  2. [INFO]ReactorSummary:
  3. [INFO]
  4. [INFO]ApacheHadoopMain................................SUCCESS[02:36min]
  5. [INFO]ApacheHadoopProjectPOM.........................SUCCESS[01:17min]
  6. [INFO]ApacheHadoopAnnotations.........................SUCCESS[34.374s]
  7. [INFO]ApacheHadoopAssemblies..........................SUCCESS[0.217s]
  8. [INFO]ApacheHadoopProjectDistPOM....................SUCCESS[41.527s]
  9. [INFO]ApacheHadoopMavenPlugins.......................SUCCESS[43.952s]
  10. [INFO]ApacheHadoopAuth................................SUCCESS[33.819s]
  11. [INFO]ApacheHadoopAuthExamples.......................SUCCESS[11.162s]
  12. [INFO]ApacheHadoopCommon..............................SUCCESS[04:40min]
  13. [INFO]ApacheHadoopNFS.................................SUCCESS[16.089s]
  14. [INFO]ApacheHadoopCommonProject......................SUCCESS[0.035s]
  15. [INFO]ApacheHadoopHDFS................................SUCCESS[02:29min]
  16. [INFO]ApacheHadoopHttpFS..............................SUCCESS[16.069s]
  17. [INFO]ApacheHadoopHDFSBookKeeperJournal.............SUCCESS[01:15min]
  18. [INFO]ApacheHadoopHDFS-NFS............................SUCCESS[3.178s]
  19. [INFO]ApacheHadoopHDFSProject........................SUCCESS[0.025s]
  20. [INFO]hadoop-yarn.......................................SUCCESS[01:17min]
  21. [INFO]hadoop-yarn-api...................................SUCCESS[41.931s]
  22. [INFO]hadoop-yarn-common................................SUCCESS[23.424s]
  23. [INFO]hadoop-yarn-server................................SUCCESS[0.077s]
  24. [INFO]hadoop-yarn-server-common.........................SUCCESS[7.492s]
  25. [INFO]hadoop-yarn-server-nodemanager....................SUCCESS[13.799s]
  26. [INFO]hadoop-yarn-server-web-proxy......................SUCCESS[3.021s]
  27. [INFO]hadoop-yarn-server-resourcemanager................SUCCESS[10.077s]
  28. [INFO]hadoop-yarn-server-tests..........................SUCCESS[0.305s]
  29. [INFO]hadoop-yarn-client................................SUCCESS[4.342s]
  30. [INFO]hadoop-yarn-applications..........................SUCCESS[0.102s]
  31. [INFO]hadoop-yarn-applications-distributedshell.........SUCCESS[3.759s]
  32. [INFO]hadoop-mapreduce-client...........................SUCCESS[0.044s]
  33. [INFO]hadoop-mapreduce-client-core......................SUCCESS[19.331s]
  34. [INFO]hadoop-yarn-applications-unmanaged-am-launcher....SUCCESS[1.776s]
  35. [INFO]hadoop-yarn-site..................................SUCCESS[0.088s]
  36. [INFO]hadoop-yarn-project...............................SUCCESS[10.864s]
  37. [INFO]hadoop-mapreduce-client-common....................SUCCESS[16.493s]
  38. [INFO]hadoop-mapreduce-client-shuffle...................SUCCESS[2.516s]
  39. [INFO]hadoop-mapreduce-client-app.......................SUCCESS[8.973s]
  40. [INFO]hadoop-mapreduce-client-hs........................SUCCESS[4.314s]
  41. [INFO]hadoop-mapreduce-client-jobclient.................SUCCESS[5.121s]
  42. [INFO]hadoop-mapreduce-client-hs-plugins................SUCCESS[1.646s]
  43. [INFO]ApacheHadoopMapReduceExamples..................SUCCESS[5.443s]
  44. [INFO]hadoop-mapreduce..................................SUCCESS[2.021s]
  45. [INFO]ApacheHadoopMapReduceStreaming.................SUCCESS[4.114s]
  46. [INFO]ApacheHadoopDistributedCopy....................SUCCESS[26.639s]
  47. [INFO]ApacheHadoopArchives............................SUCCESS[1.992s]
  48. [INFO]ApacheHadoopRumen...............................SUCCESS[5.204s]
  49. [INFO]ApacheHadoopGridmix.............................SUCCESS[3.827s]
  50. [INFO]ApacheHadoopDataJoin...........................SUCCESS[2.590s]
  51. [INFO]ApacheHadoopExtras..............................SUCCESS[2.658s]
  52. [INFO]ApacheHadoopPipes...............................SUCCESS[6.587s]
  53. [INFO]ApacheHadoopToolsDist..........................SUCCESS[1.103s]
  54. [INFO]ApacheHadoopTools...............................SUCCESS[0.023s]
  55. [INFO]ApacheHadoopDistribution........................SUCCESS[7.099s]
  56. [INFO]ApacheHadoopClient..............................SUCCESS[2.781s]
  57. [INFO]ApacheHadoopMini-Cluster........................SUCCESS[0.072s]
  58. [INFO]------------------------------------------------------------------------
  59. [INFO]BUILDSUCCESS
  60. [INFO]------------------------------------------------------------------------
  61. [INFO]Totaltime:21:12min
  62. [INFO]Finishedat:2014-03-18T06:35:50+00:00
  63. [INFO]FinalMemory:141M/461M
  64. [INFO]------------------------------------------------------------------------
 [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] Apache Hadoop Main ................................ SUCCESS [02:36 min] [INFO] Apache Hadoop Project POM ......................... SUCCESS [01:17 min] [INFO] Apache Hadoop Annotations ......................... SUCCESS [ 34.374 s] [INFO] Apache Hadoop Assemblies .......................... SUCCESS [ 0.217 s] [INFO] Apache Hadoop Project Dist POM .................... SUCCESS [ 41.527 s] [INFO] Apache Hadoop Maven Plugins ....................... SUCCESS [ 43.952 s] [INFO] Apache Hadoop Auth ................................ SUCCESS [ 33.819 s] [INFO] Apache Hadoop Auth Examples ....................... SUCCESS [ 11.162 s] [INFO] Apache Hadoop Common .............................. SUCCESS [04:40 min] [INFO] Apache Hadoop NFS ................................. SUCCESS [ 16.089 s] [INFO] Apache Hadoop Common Project ...................... SUCCESS [ 0.035 s] [INFO] Apache Hadoop HDFS ................................ SUCCESS [02:29 min] [INFO] Apache Hadoop HttpFS .............................. SUCCESS [ 16.069 s] [INFO] Apache Hadoop HDFS BookKeeper Journal ............. SUCCESS [01:15 min] [INFO] Apache Hadoop HDFS-NFS ............................ SUCCESS [ 3.178 s] [INFO] Apache Hadoop HDFS Project ........................ SUCCESS [ 0.025 s] [INFO] hadoop-yarn ....................................... SUCCESS [01:17 min] [INFO] hadoop-yarn-api ................................... SUCCESS [ 41.931 s] [INFO] hadoop-yarn-common ................................ SUCCESS [ 23.424 s] [INFO] hadoop-yarn-server ................................ SUCCESS [ 0.077 s] [INFO] hadoop-yarn-server-common ......................... SUCCESS [ 7.492 s] [INFO] hadoop-yarn-server-nodemanager .................... SUCCESS [ 13.799 s] [INFO] hadoop-yarn-server-web-proxy ...................... SUCCESS [ 3.021 s] [INFO] hadoop-yarn-server-resourcemanager ................ SUCCESS [ 10.077 s] [INFO] hadoop-yarn-server-tests .......................... SUCCESS [ 0.305 s] [INFO] hadoop-yarn-client ................................ SUCCESS [ 4.342 s] [INFO] hadoop-yarn-applications .......................... SUCCESS [ 0.102 s] [INFO] hadoop-yarn-applications-distributedshell ......... SUCCESS [ 3.759 s] [INFO] hadoop-mapreduce-client ........................... SUCCESS [ 0.044 s] [INFO] hadoop-mapreduce-client-core ...................... SUCCESS [ 19.331 s] [INFO] hadoop-yarn-applications-unmanaged-am-launcher .... SUCCESS [ 1.776 s] [INFO] hadoop-yarn-site .................................. SUCCESS [ 0.088 s] [INFO] hadoop-yarn-project ............................... SUCCESS [ 10.864 s] [INFO] hadoop-mapreduce-client-common .................... SUCCESS [ 16.493 s] [INFO] hadoop-mapreduce-client-shuffle ................... SUCCESS [ 2.516 s] [INFO] hadoop-mapreduce-client-app ....................... SUCCESS [ 8.973 s] [INFO] hadoop-mapreduce-client-hs ........................ SUCCESS [ 4.314 s] [INFO] hadoop-mapreduce-client-jobclient ................. SUCCESS [ 5.121 s] [INFO] hadoop-mapreduce-client-hs-plugins ................ SUCCESS [ 1.646 s] [INFO] Apache Hadoop MapReduce Examples .................. SUCCESS [ 5.443 s] [INFO] hadoop-mapreduce .................................. SUCCESS [ 2.021 s] [INFO] Apache Hadoop MapReduce Streaming ................. SUCCESS [ 4.114 s] [INFO] Apache Hadoop Distributed Copy .................... SUCCESS [ 26.639 s] [INFO] Apache Hadoop Archives ............................ SUCCESS [ 1.992 s] [INFO] Apache Hadoop Rumen ............................... SUCCESS [ 5.204 s] [INFO] Apache Hadoop Gridmix ............................. SUCCESS [ 3.827 s] [INFO] Apache Hadoop Data Join ........................... SUCCESS [ 2.590 s] [INFO] Apache Hadoop Extras .............................. SUCCESS [ 2.658 s] [INFO] Apache Hadoop Pipes ............................... SUCCESS [ 6.587 s] [INFO] Apache Hadoop Tools Dist .......................... SUCCESS [ 1.103 s] [INFO] Apache Hadoop Tools ............................... SUCCESS [ 0.023 s] [INFO] Apache Hadoop Distribution ........................ SUCCESS [ 7.099 s] [INFO] Apache Hadoop Client .............................. SUCCESS [ 2.781 s] [INFO] Apache Hadoop Mini-Cluster ........................ SUCCESS [ 0.072 s] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 21:12 min [INFO] Finished at: 2014-03-18T06:35:50+00:00 [INFO] Final Memory: 141M/461M [INFO] ------------------------------------------------------------------------
编译安装完成结果信息。
  1. [root@testhadoop-2.2.0-src]#cdhadoop-dist/target/hadoop-2.2.0/
  2. [root@testhadoop-2.2.0]#ll
  3. 总用量28
  4. drwxr-xr-x.2rootroot40963月1806:35bin
  5. drwxr-xr-x.3rootroot40963月1806:35etc
  6. drwxr-xr-x.2rootroot40963月1806:35include
  7. drwxr-xr-x.3rootroot40963月1806:35lib
  8. drwxr-xr-x.2rootroot40963月1806:35libexec
  9. drwxr-xr-x.2rootroot40963月1806:35sbin
  10. drwxr-xr-x.4rootroot40963月1806:35share
  11. [root@masterhadoop-2.2.0]#pwd
  12. /root/hadoop-2.2.0-src/hadoop-dist/target/hadoop-2.2.0
 [root@test hadoop-2.2.0-src]# cd hadoop-dist/target/hadoop-2.2.0/ [root@test hadoop-2.2.0]# ll 总用量 28 drwxr-xr-x. 2 root root 4096 3月 18 06:35 bin drwxr-xr-x. 3 root root 4096 3月 18 06:35 etc drwxr-xr-x. 2 root root 4096 3月 18 06:35 include drwxr-xr-x. 3 root root 4096 3月 18 06:35 lib drwxr-xr-x. 2 root root 4096 3月 18 06:35 libexec drwxr-xr-x. 2 root root 4096 3月 18 06:35 sbin drwxr-xr-x. 4 root root 4096 3月 18 06:35 share [root@master hadoop-2.2.0]# pwd /root/hadoop-2.2.0-src/hadoop-dist/target/hadoop-2.2.0
查看版本。
  1. [root@masterhadoop-2.2.0]#exportJAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk.x86_64/
  2. [root@masterhadoop-2.2.0]#bin/hadoopversion
  3. Hadoop2.2.0
  4. SubversionUnknown-rUnknown
  5. Compiledbyrooton2014-03-18T06:24Z
  6. Compiledwithprotoc2.5.0
  7. Fromsourcewithchecksum79e53ce7994d1628b240f09af91e1af4
  8. Thiscommandwasrunusing/root/hadoop-2.2.0-src/hadoop-dist/target/hadoop-2.2.0/share/hadoop/common/hadoop-common-2.2.0.jar
 [root@master hadoop-2.2.0]# export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk.x86_64/ [root@master hadoop-2.2.0]# bin/hadoop version Hadoop 2.2.0 Subversion Unknown -r Unknown Compiled by root on 2014-03-18T06:24Z Compiled with protoc 2.5.0 From source with checksum 79e53ce7994d1628b240f09af91e1af4 This command was run using /root/hadoop-2.2.0-src/hadoop-dist/target/hadoop-2.2.0/share/hadoop/common/hadoop-common-2.2.0.jar
编译完成,谢谢!

参考

http://hadoop.apache.org/

http://zh.wikipedia.org/zh-cn/Apache_Hadoop

http://book.51cto.com/art/201004/196447.htm

http://www.superwu.cn/2013/12/26/913/

http://zh.wikipedia.org/wiki/Apache_Maven