搭建环境:Centos 6.4 64bit

1、安装JDK 参考这里
2、安装maven
maven官方下载地址,可以选择源码编码安装,这里就直接下载编译好的
wget http://mirror.bit.edu.cn/apache/maven/maven-3/3.1.1/binaries/apache-maven-3.1.1-bin.zip
解压文件后,同样在/etc/profie里配置环境变量
vim /etc/profie
export MAVEN_HOME=/opt/maven3.1.1
export PATH=$PATH:$MAVEN_HOME/bin
source /etc/profile
验证配置是否成功: mvn -version

Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 23:22:22+0800)
Maven home: /opt/maven3.1.1
Java version: 1.7.0_45, vendor: Oracle Corporation
Java home: /opt/jdk1.7/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-358.el6.x86_64", arch: "amd64", family: "unix"

由于maven国外服务器可能连不上,先给maven配置一下国内镜像,在maven目录下,conf/settings.xml,在<mirrors></mirros>里添加,原本的不要动
<mirror>
<id>nexus-osc</id>
<mirrorOf>*</mirrorOf>
<name>Nexusosc</name>
<url>http://maven.oschina.net/content/groups/public/</url>
</mirror>
同样,在<profiles></profiles>内新添加
<profile>
<id>jdk-1.7</id>
<activation>
<jdk>1.7</jdk>
</activation>
<repositories>
<repository>
<id>nexus</id>
<name>local private nexus</name>
<url>http://maven.oschina.net/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>nexus</id>
<name>local private nexus</name>
<url>http://maven.oschina.net/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
3、安装protoc2.5.0
hadoop2.2.0编译需要protoc2.5.0的支持,所以还要下载protoc,
下载地址:https://code.google.com/p/protobuf/downloads/list,要下载2.5.0版本噢
对protoc进行编译安装前先要装几个依赖包:gcc,gcc-c++,make 如果已经安装的可以忽略
yum install gcc
yum intall gcc-c++
yum install make
安装protoc
tar -xvf protobuf-2.5.0.tar.bz2
cd protobuf-2.5.0
./configure --prefix=/opt/protoc/
make && make install
4、需要安装cmake,openssl-devel,ncurses-devel依赖 如果已经安装的可以忽略
yum install cmake
yum install openssl-devel
yum install ncurses-devel
5、编译hadoop
首先官方下载hadoop源码
wget http://mirrors.cnnic.cn/apache/hadoop/common/hadoop-2.2.0/hadoop-2.2.0-src.tar.gz
现在可以进行编译了,
cd hadoop2.2.0-src
mvn package -Pdist,native -DskipTests -Dtar

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Apache Hadoop Main ................................ SUCCESS [3.709s]
[INFO] Apache Hadoop Project POM ......................... SUCCESS [2.229s]
[INFO] Apache Hadoop Annotations ......................... SUCCESS [5.270s]
[INFO] Apache Hadoop Assemblies .......................... SUCCESS [0.388s]
[INFO] Apache Hadoop Project Dist POM .................... SUCCESS [3.485s]
[INFO] Apache Hadoop Maven Plugins ....................... SUCCESS [8.655s]
[INFO] Apache Hadoop Auth ................................ SUCCESS [7.782s]
[INFO] Apache Hadoop Auth Examples ....................... SUCCESS [5.731s]
[INFO] Apache Hadoop Common .............................. SUCCESS [1:52.476s]
[INFO] Apache Hadoop NFS ................................. SUCCESS [9.935s]
[INFO] Apache Hadoop Common Project ...................... SUCCESS [0.110s]
[INFO] Apache Hadoop HDFS ................................ SUCCESS [1:58.347s]
[INFO] Apache Hadoop HttpFS .............................. SUCCESS [26.915s]
[INFO] Apache Hadoop HDFS BookKeeper Journal ............. SUCCESS [17.002s]
[INFO] Apache Hadoop HDFS-NFS ............................ SUCCESS [5.292s]
[INFO] Apache Hadoop HDFS Project ........................ SUCCESS [0.073s]
[INFO] hadoop-yarn ....................................... SUCCESS [0.335s]
[INFO] hadoop-yarn-api ................................... SUCCESS [54.478s]
[INFO] hadoop-yarn-common ................................ SUCCESS [39.215s]
[INFO] hadoop-yarn-server ................................ SUCCESS [0.241s]
[INFO] hadoop-yarn-server-common ......................... SUCCESS [15.601s]
[INFO] hadoop-yarn-server-nodemanager .................... SUCCESS [21.566s]
[INFO] hadoop-yarn-server-web-proxy ...................... SUCCESS [4.754s]
[INFO] hadoop-yarn-server-resourcemanager ................ SUCCESS [20.625s]
[INFO] hadoop-yarn-server-tests .......................... SUCCESS [0.755s]
[INFO] hadoop-yarn-client ................................ SUCCESS [6.748s]
[INFO] hadoop-yarn-applications .......................... SUCCESS [0.155s]
[INFO] hadoop-yarn-applications-distributedshell ......... SUCCESS [4.661s]
[INFO] hadoop-mapreduce-client ........................... SUCCESS [0.160s]
[INFO] hadoop-mapreduce-client-core ...................... SUCCESS [36.090s]
[INFO] hadoop-yarn-applications-unmanaged-am-launcher .... SUCCESS [2.753s]
[INFO] hadoop-yarn-site .................................. SUCCESS [0.151s]
[INFO] hadoop-yarn-project ............................... SUCCESS [4.771s]
[INFO] hadoop-mapreduce-client-common .................... SUCCESS [24.870s]
[INFO] hadoop-mapreduce-client-shuffle ................... SUCCESS [3.812s]
[INFO] hadoop-mapreduce-client-app ....................... SUCCESS [15.759s]
[INFO] hadoop-mapreduce-client-hs ........................ SUCCESS [6.831s]
[INFO] hadoop-mapreduce-client-jobclient ................. SUCCESS [8.126s]
[INFO] hadoop-mapreduce-client-hs-plugins ................ SUCCESS [2.320s]
[INFO] Apache Hadoop MapReduce Examples .................. SUCCESS [9.596s]
[INFO] hadoop-mapreduce .................................. SUCCESS [3.905s]
[INFO] Apache Hadoop MapReduce Streaming ................. SUCCESS [7.118s]
[INFO] Apache Hadoop Distributed Copy .................... SUCCESS [11.651s]
[INFO] Apache Hadoop Archives ............................ SUCCESS [2.671s]
[INFO] Apache Hadoop Rumen ............................... SUCCESS [10.038s]
[INFO] Apache Hadoop Gridmix ............................. SUCCESS [6.062s]
[INFO] Apache Hadoop Data Join ........................... SUCCESS [4.104s]
[INFO] Apache Hadoop Extras .............................. SUCCESS [4.210s]
[INFO] Apache Hadoop Pipes ............................... SUCCESS [9.419s]
[INFO] Apache Hadoop Tools Dist .......................... SUCCESS [2.306s]
[INFO] Apache Hadoop Tools ............................... SUCCESS [0.037s]
[INFO] Apache Hadoop Distribution ........................ SUCCESS [21.579s]
[INFO] Apache Hadoop Client .............................. SUCCESS [7.299s]
[INFO] Apache Hadoop Mini-Cluster ........................ SUCCESS [7.347s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11:53.144s
[INFO] Finished at: Fri Nov 22 16:58:32 CST 2013
[INFO] Final Memory: 70M/239M
[INFO] ------------------------------------------------------------------------
直到看到上面的内容那就说明编译完成了。

编译后的路径在:hadoop-2.2.0-src/hadoop-dist/target/hadoop-2.2.0
通过一下命令可以看出hadoop的版本
[root@localhost bin]# ./hadoop version
Hadoop 2.2.0
Subversion Unknown -r Unknown
Compiled by root on 2013-11-22T08:47Z
Compiled with protoc 2.5.0
From source with checksum 79e53ce7994d1628b240f09af91e1af4
This command was run using /data/hadoop-2.2.0-src/hadoop-dist/target/hadoop-2.2.0/share/hadoop/common/hadoop-common-2.2.0.jar

[root@localhost hadoop-2.2.0]# file lib//native/*
lib//native/libhadoop.a: current ar archive
lib//native/libhadooppipes.a: current ar archive
lib//native/libhadoop.so: symbolic link to `libhadoop.so.1.0.0'
lib//native/libhadoop.so.1.0.0: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped
lib//native/libhadooputils.a: current ar archive
lib//native/libhdfs.a: current ar archive
lib//native/libhdfs.so: symbolic link to `libhdfs.so.0.0.0'
lib//native/libhdfs.so.0.0.0: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped

CentOS 6.4 64位 源码编译hadoop 2.2.0的更多相关文章

  1. Centos6.8-hadoop-2.7.2 64 bit源码编译(伪分布-5大守护进程在本机上)

    1.安装插件 安装jdk/ant/libtool/protobuf/maven/zlib-devel/openssl-devel/ncurses-devel.gcc.snappy.bzip #set ...

  2. [笔记] Ubuntu 18.04源码编译安装OpenCV 4.0流程

    标准常规安装方法安装的OpenCV版本比较低,想尝鲜使用4.0版本,只好源码安装. 安装环境 OS:Ubuntu 18.04 64 bit 显卡:NVidia GTX 1080 CUDA:10.0 c ...

  3. 保姆级教程——Ubuntu16.04 Server下深度学习环境搭建:安装CUDA8.0,cuDNN6.0,Bazel0.5.4,源码编译安装TensorFlow1.4.0(GPU版)

    写在前面 本文叙述了在Ubuntu16.04 Server下安装CUDA8.0,cuDNN6.0以及源码编译安装TensorFlow1.4.0(GPU版)的亲身经历,包括遇到的问题及解决办法,也有一些 ...

  4. 源码编译安装 PHP5.5.0,解决curl_exec访问HTTPS返回502错误的问题(修改PATH路径)

    最近碰到一个奇怪的问题, PHP使用 curl_exec 访问 HTTPS 网页时, 返回502错误, 访问HTTP网页时没有问题,  用   echo   phpinfo() ;  查看, 支持op ...

  5. tensorflow 源码编译tensorflow 1.1.0到 tensorflow 2.0,ver:1.1.0rc1、1.4.0rc1、1.14.0-rc1、2.0.0b1

    目录 tensorflow-build table 更多详细过程信息及下载: tensorflow-build tensorflow 源码编译,提升硬件加速,支持cpu加速指令,suport SSE4 ...

  6. 在 CentOS 7.5 64位上使用 yum 安装 MySQL 8.0

    前段时间在 CentOS 7.5 64位上安装 MySQL 8.0.查了些资料,在这里记录一下详细的安装和设置步骤. 一.安装 使用yum安装MySQL之前需要先下载对应的.rpm文件,下载方法: 去 ...

  7. [环境配置]Ubuntu 16.04 源码编译安装OpenCV-3.2.0+OpenCV_contrib-3.2.0及产生的问题

    1.OpenCV-3.2.0+OpenCV_contrib-3.2.0编译安装过程 1)下载官方要求的依赖包 GCC 4.4.x or later CMake 2.6 or higher Git GT ...

  8. 源码编译安装gcc-5.3.0

    系统环境:Amazon Linux AMI 2015.09.2 (HVM)---Fedora 23 Server 1.下载gcc-5.3.0安装包并将gcc-5.3.0.tar.gz放到/opt目录下 ...

  9. 64位Win7下编译hadoop 1.2.1问题解决

    0.报sed的错误.原因在于没有安装cygwin.安装cygwin的时候要选择sed 1.Cannot run program "autoreconf". 这个问题在网上看了很多解 ...

随机推荐

  1. solr ,hadoop ,lucene,nutch 的关系和区别

    apache lucene是apache下一个著名的开源搜索引擎内核,基于Java技术,处理索引,拼写检查,点击高亮和其他分析,分词等技术. nutch和solr原来都是lucene下的子项目.但后来 ...

  2. Coppersmith-Winograd 算法

    转自:https://www.douban.com/group/topic/29658298/ 对正整数 $q$,定义张量 $T$,其对应的多项式为 $p(X,Y,Z)=\sum_{i=1}^q (X ...

  3. July收集荷兰国旗问题之三路partition

    这道题目和分成两块的partition的扩展.比如有一堆0 1 2 数字组成的数组,要分成 00 00  11 1 1  222 2这样的顺序的. 利用lumoto版的partition能够非常好的解 ...

  4. U磁盘检测和大量收集量产工具

    1.ChipGenius ChipGenius是一款USB设备芯片型号检測工具,能够自己主动查询U盘.MP3/MP4.读卡器.移动硬盘等一切USB设备的主控芯片型号.制造商.品牌.并提供相关资料下载地 ...

  5. 开启.htaccess重写之前先来看看mod_rewrite(转)

    Apache的Mode Rewrite模块提供了一个基于正则表达式分析器的重写引擎来实时重写URL请求.在大多数情况下,它和.htaccess文件配合使用.就是说,.htaccess文件的一个主要功能 ...

  6. S2SH框架集成详解(Struts 2.3.16 + Spring 3.2.6 + Hibernate 3.6.10)

    近期集成了一次较新版本的s2sh,出现了不少问题,网上资料也是良莠不齐,有的甚至就是扯淡,简单的把jar包扔进去就以为是集成成功了,在这里整理一下详细的步骤,若哪位有什么不同看法,可以留言,欢迎批评改 ...

  7. Oracle sequence排序的使用

    最近公司的项目中好多用到了Seq排序的,所以网上找些记录一下吧. 通过以下直接查询出所有的seq列表: select * from user_sequences; 查询结果如下: 查询结果和创建的基本 ...

  8. NSString截取文件名(很笨的方法)

    对NSString的操作不熟悉,目前采用以下方法取得路径中的文件名以及文件夹路径 NSString* test=[[NSString alloc]initWithFormat:@"D:\\c ...

  9. HUD 2444 The Accomodation of Students (二分图染色+最大匹配)

    #include<iostream> #include<cstdio> #include<cstring> #define maxn 2010 using name ...

  10. jquery $('#btn').click与$("#btn").live("click",function()有什么区别?

    live方法绑定的事件处理函数,在页面中未来添加的元素只要满足原来的选择器,仍然会导致事件触发.普通的事件绑定则没有这个效果.对于#btn这个选择器来说,如果你未来将id为btn的元素删除,然后再创建 ...