Apache官方提供hadoop2的安装包是在32位机器下编译的,生产环境一般使用64的Linux,那么需要在64位机器下重新编译
可以查看hadoop-2.2.0-src下的BUILDING.txt
Build instructions for Hadoop

----------------------------------------------------------------------------------
Requirements:

* Unix System
* JDK 1.6+
* Maven 3.0 or later
* Findbugs 1.3.9 (if running findbugs)
* ProtocolBuffer 2.5.0
* CMake 2.6 or newer (if compiling native code)
* Internet connection for first build (to fetch all Maven and Hadoop dependencies)

----------------------------------------------------------------------------------
...
步骤:
1.安装JDK 1.6+ (验证:java -version)
2.安装Maven 3.0 or later (验证:mvn -version)
3.ProtocolBuffer 2.5.0 (验证:protoc --version)下载地址:https://protobuf.googlecode.com/files/protobuf-2.5.0.tar.gz
#为了编译安装protobuf,Linux需要上网,使用YUM在线安装依赖。如不能上网,就比较麻烦,需要一一下载每个依赖包再安装。
sudo yum install gcc
sudo yum install gcc-c++
sudo yum install make

#解压protobuf
sudo tar -zxvf protobuf-2.5.0.tar.gz
#进入到protobuf-2.5.0
cd protobuf-2.5.0
#编译安装
sudo ./configure
sudo make
sudo make install
4.安装CMake 2.6 or newer
sudo yum install cmake
sudo yum install openssl-devel
sudo yum install ncurses-devel
5.编译hadoop-2.2.0
#解压hadoop-2.2.0-src.tar.gz
tar -zxvf hadoop-2.2.0-src.tar.gz
#进入到hadoop-2.2.0-src
cd hadoop-2.2.0-src

#hadoop-2.2.0-src/hadoop-common-project/hadoop-auth/pom.xml有个bug,这里需要修改一下
vim hadoop-common-project/hadoop-auth/pom.xml
#在<dependencies>标签内添加如下内容
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-util</artifactId>
<scope>test</scope>
</dependency>

#编译
mvn package -DskipTests -Pdist,native

#编译好的hadoop-2.2.0再hadoop-2.2.0-src/hadoop-dist/target目录下

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Apache Hadoop Main ................................ SUCCESS [ 1.228 s]
[INFO] Apache Hadoop Project POM ......................... SUCCESS [ 0.894 s]
[INFO] Apache Hadoop Annotations ......................... SUCCESS [ 1.809 s]
[INFO] Apache Hadoop Assemblies .......................... SUCCESS [ 0.222 s]
[INFO] Apache Hadoop Project Dist POM .................... SUCCESS [ 1.198 s]
[INFO] Apache Hadoop Maven Plugins ....................... SUCCESS [ 2.205 s]
[INFO] Apache Hadoop Auth ................................ SUCCESS [ 2.169 s]
[INFO] Apache Hadoop Auth Examples ....................... SUCCESS [ 1.583 s]
[INFO] Apache Hadoop Common .............................. SUCCESS [01:02 min]
[INFO] Apache Hadoop NFS ................................. SUCCESS [ 5.132 s]
[INFO] Apache Hadoop Common Project ...................... SUCCESS [ 0.038 s]
[INFO] Apache Hadoop HDFS ................................ SUCCESS [01:02 min]
[INFO] Apache Hadoop HttpFS .............................. SUCCESS [ 9.002 s]
[INFO] Apache Hadoop HDFS BookKeeper Journal ............. SUCCESS [ 4.995 s]
[INFO] Apache Hadoop HDFS-NFS ............................ SUCCESS [ 2.647 s]
[INFO] Apache Hadoop HDFS Project ........................ SUCCESS [ 0.058 s]
[INFO] hadoop-yarn ....................................... SUCCESS [ 0.138 s]
[INFO] hadoop-yarn-api ................................... SUCCESS [ 31.854 s]
[INFO] hadoop-yarn-common ................................ SUCCESS [ 20.121 s]
[INFO] hadoop-yarn-server ................................ SUCCESS [ 0.105 s]
[INFO] hadoop-yarn-server-common ......................... SUCCESS [ 5.776 s]
[INFO] hadoop-yarn-server-nodemanager .................... SUCCESS [ 10.490 s]
[INFO] hadoop-yarn-server-web-proxy ...................... SUCCESS [ 3.321 s]
[INFO] hadoop-yarn-server-resourcemanager ................ SUCCESS [ 8.311 s]
[INFO] hadoop-yarn-server-tests .......................... SUCCESS [ 0.510 s]
[INFO] hadoop-yarn-client ................................ SUCCESS [ 3.929 s]
[INFO] hadoop-yarn-applications .......................... SUCCESS [ 0.060 s]
[INFO] hadoop-yarn-applications-distributedshell ......... SUCCESS [ 1.720 s]
[INFO] hadoop-mapreduce-client ........................... SUCCESS [ 0.062 s]
[INFO] hadoop-mapreduce-client-core ...................... SUCCESS [ 16.204 s]
[INFO] hadoop-yarn-applications-unmanaged-am-launcher .... SUCCESS [ 1.779 s]
[INFO] hadoop-yarn-site .................................. SUCCESS [ 0.111 s]
[INFO] hadoop-yarn-project ............................... SUCCESS [ 2.287 s]
[INFO] hadoop-mapreduce-client-common .................... SUCCESS [ 11.855 s]
[INFO] hadoop-mapreduce-client-shuffle ................... SUCCESS [ 2.560 s]
[INFO] hadoop-mapreduce-client-app ....................... SUCCESS [ 6.985 s]
[INFO] hadoop-mapreduce-client-hs ........................ SUCCESS [ 3.319 s]
[INFO] hadoop-mapreduce-client-jobclient ................. SUCCESS [ 4.021 s]
[INFO] hadoop-mapreduce-client-hs-plugins ................ SUCCESS [ 1.508 s]
[INFO] Apache Hadoop MapReduce Examples .................. SUCCESS [ 4.176 s]
[INFO] hadoop-mapreduce .................................. SUCCESS [ 2.367 s]
[INFO] Apache Hadoop MapReduce Streaming ................. SUCCESS [ 2.902 s]
[INFO] Apache Hadoop Distributed Copy .................... SUCCESS [ 5.365 s]
[INFO] Apache Hadoop Archives ............................ SUCCESS [ 1.673 s]
[INFO] Apache Hadoop Rumen ............................... SUCCESS [ 4.095 s]
[INFO] Apache Hadoop Gridmix ............................. SUCCESS [ 2.962 s]
[INFO] Apache Hadoop Data Join ........................... SUCCESS [ 2.089 s]
[INFO] Apache Hadoop Extras .............................. SUCCESS [ 2.190 s]
[INFO] Apache Hadoop Pipes ............................... SUCCESS [ 5.887 s]
[INFO] Apache Hadoop Tools Dist .......................... SUCCESS [ 1.149 s]
[INFO] Apache Hadoop Tools ............................... SUCCESS [ 0.028 s]
[INFO] Apache Hadoop Distribution ........................ SUCCESS [ 6.514 s]
[INFO] Apache Hadoop Client .............................. SUCCESS [ 2.199 s]
[INFO] Apache Hadoop Mini-Cluster ........................ SUCCESS [ 0.121 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS (####看到BUILD SUCCESS说明编译成功####)
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 05:39 min
[INFO] Finished at: 2014-05-23T13:37:06+08:00
[INFO] Final Memory: 135M/300M
[INFO] ------------------------------------------------------------------------

关于64位Linux编译hadoop2的更多相关文章

  1. 64位Linux编译hadoop-2.5.1

    Apache Hadoop生态系统安装包下载地址:http://archive.apache.org/dist/ 软件安装目录:~/app jdk: jdk-7u45-linux-x64.rpm ha ...

  2. 64位Linux编译C代码,crt1.o文件格式不对的问题

    今天在某台64位LInux下编译一个简单的hello world的C程序,报错: /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../crt1.o: cou ...

  3. CentOS 64位上编译 Hadoop2.6.0

    由于hadoop-2.6.0.tar.gz安装包是在32位机器上编译的,64位的机器加载本地库.so文件时会出错,比如: java.lang.UnsatisfiedLinkError: org.apa ...

  4. 64位linux编译32位程序

    昨天接到的任务,编译64位和32位两个版本的.so动态库给其他部门,我的ubuntu虚拟机是64位的,编译32位时遇到了问题: /usr/bin/ld: cannot find -lstdc++ 最后 ...

  5. linux下hadoop2.6.1源码64位的编译

    linux下hadoop2.6.1源码64位的编译 一. 前言 Apache官网上提供的hadoop本地库是32位的,如果我们的Linux服务器是64位的话,就会现问题.我们在64位服务器执行Hado ...

  6. 在64位linux下编译32位程序

    在64位linux下编译32位程序 http://blog.csdn.net/xsckernel/article/details/38045783

  7. MiniCRT 64位 linux 系统移植记录:64位gcc的几点注意

    32位未修改源码与修改版的代码下载: git clone git@github.com:youzhonghui/MiniCRT.git MiniCRT 64位 linux 系统移植记录 MiniCRT ...

  8. /usr/local/lib/libz.a: could not read symbols: Bad value(64 位 Linux)

    /usr/local/lib/libz.a: could not read symbols: Bad value(64 位 Linux) /usr/bin/ld: /usr/local/lib/lib ...

  9. 64位linux报错Could not initialize class java.awt.image.BufferedImage

    最近碰到一个问题: 64位linux报错Could not initialize class java.awt.image.BufferedImage 在WIN平台下运行正常BufferedImage ...

随机推荐

  1. Spring Auto-Wiring Beans with @Autowired annotation

    In last Spring auto-wiring in XML example, it will autowired the matched property of any bean in cur ...

  2. Mysql常见报错解决方法

    一:登录报错 ERROR 1045 (28000): Access denied for user 'mysql'@'localhost' (using password: NO) mysql日志文件 ...

  3. BestCoder Round #71 (div.2) (hdu 5620 菲波那切数列变形)

    KK's Steel Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total ...

  4. [iOS UI进阶 - 6.0] CALayer

    A.基本知识 1.需要掌握的 CALayer的基本属性 CALayer和UIView的关系 position和anchorPoint的作用   2.概念 在iOS中,你能看得见摸得着的东西基本上都是U ...

  5. 写的一个判断注册Email是否是个人邮件,而不是公司邮件的方法

    以下这个方法其实也不是很全面,它只判断了hotmail, gmail和yahoo 如果你还需要加上其他认为是私人Email的Email, 只要按照同样的方法自己加上就可以了 Public void C ...

  6. CodeForces 548B Mike and Fun (模拟)

    题意:给定一个n*m的矩阵,都是01矩阵,然后每次一个询问,改变一个格的值,然后问你最大有数是多少. 析:就是按他说的模拟,要预处理,只要把每行的最大值记下来,当改变时,再更新这一行的最大值. 代码如 ...

  7. Zabbix3.0完整部署

    0. 准备工作 0.1 初始化 #!/bin/sh yum clean all systemctl stop firewalld.service systemctl disable firewalld ...

  8. CentOS 7安装iptables服务,以及常用命令

    之前使用的是CentOS6.5,并且学艺不精,用啥查啥,用完就忘.并且网上大部分资料是基于CentOS7之前的版本. 在CentOS7中,默认的防火墙不是iptables,而是firewalld.而且 ...

  9. 非IE内核浏览器支持activex插件

    之前在一个B/S项目中遇到一个需求,就是客户需要在页面上对报表的布局以及显示内容,进行自定义.最后决定使用activex技术来实现.众所周知,activex是微软搞得,因此只有ie内核的浏览器才能支持 ...

  10. SpringMVC4.2.4 xml配置

    环境:1.基于spring4.2.4版本,也是spring当前(2016.2)最新的GA版本 2.maven 3.2.1 3.jdk1.7 xml配置1: web.xml <?xml versi ...