RedHat Ent 6.5 64bit编译安装hadoop2.4.1

感谢原帖:http://blog.csdn.net/w13770269691/article/details/16883663/

step 1.修改yum:(针对redhat ent未注册用户,注册用户直接跳过这一步)

参考:http://blog.csdn.net/zhngjan/article/details/20843465

step 2.下载源码包:http://mirrors.hust.edu.cn/apache/hadoop/common/stable2/

wget http://mirrors.hust.edu.cn/apache/hadoop/common/stable2/hadoop-2.4.1-src.tar.gz

step 3.准备maven作为编译hadoop的工具

a.下载编译好的maven包:

wget http://mirror.bit.edu.cn/apache/maven/maven-3/3.1.1/binaries/apache-maven-3.1.1-bin.tar.gz
tar -zxvf apache-maven-3.1.1-bin.tar.gz -C /opt/

b.配置maven的环境变量,在/etc/profile文件结尾中添加如下代码

export MAVEN_HOME=/opt/apache-maven-3.1.
export PATH=$PATH:${MAVEN_HOME}/bin

c.执行如下命令使配置文件生效

source /etc/profile

d.测试maven

mvn -version

e.由于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>

在maven目录下,conf/settings.xml,在<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>

step 4.hadoop2.4.1编译需要protoc2.5.0的支持,所以还要安装下载protoc2.5.0

官方网址:https://code.google.com/p/protobuf/downloads/list

百度网盘网址:http://pan.baidu.com/s/1pJlZubT

a.对protoc进行编译安装前先要装几个依赖包:gcc,gcc-c++,make 如果已经安装的可以忽略

yum install gcc
yum intall gcc-c++
yum install make

b.配置protoc

tar -xvf protobuf-2.5..tar.bz2
cd protobuf-2.5.
./configure --prefix=/opt/protoc/
make && make install
yum install gcc

红色字体是自定义的protoc安装目录,完成上面的命令后,再配置protoc环境变量,同样在/etc/profile尾部加入:

export PATH=/opt/protoc/bin:$PATH

step 5.,还不要着急开始编译安装,不然又是各种错误,需要安装cmake,openssl-devel,ncurses-devel依赖

yum install cmake
yum install openssl-devel
yum install ncurses-devel

step 6. 解压并编译hadoop源码(一定要进入到源码解压的位置再执行mvn编译)

tar -zxvf hadoop-2.4.1-src.tar.gz -C /opt/
cd /opt/hadoop-2.4.1-src
mvn package -Pdist,native -DskipTests -Dtar

编译耗时比较长,耐心等待,成功后结果类似于:

 pache Hadoop Distributed Copy .................... SUCCESS [.648s]
[INFO] Apache Hadoop Archives ............................ SUCCESS [.303s]
[INFO] Apache Hadoop Rumen ............................... SUCCESS [.288s]
[INFO] Apache Hadoop Gridmix ............................. SUCCESS [.611s]
[INFO] Apache Hadoop Data Join ........................... SUCCESS [.334s]
[INFO] Apache Hadoop Extras .............................. SUCCESS [.737s]
[INFO] Apache Hadoop Pipes ............................... SUCCESS [.321s]
[INFO] Apache Hadoop OpenStack support ................... SUCCESS [.136s]
[INFO] Apache Hadoop Client .............................. SUCCESS [.563s]
[INFO] Apache Hadoop Mini-Cluster ........................ SUCCESS [.254s]
[INFO] Apache Hadoop Scheduler Load Simulator ............ SUCCESS [.245s]
[INFO] Apache Hadoop Tools Dist .......................... SUCCESS [.478s]
[INFO] Apache Hadoop Tools ............................... SUCCESS [.084s]
[INFO] Apache Hadoop Distribution ........................ SUCCESS [.979s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: :.464s
[INFO] Finished at: Thu Aug :: CST
[INFO] Final Memory: 159M/814M
[INFO] ------------------------------------------------------------------------
You have new mail in /var/spool/mail/root

编译后的路径在:hadoop-2.4.1-src/hadoop-dist/target/hadoop-2.4.1

进入hadoop-2.4.1目录,测试安装是否成功

[root@cupcs-redhat6 bin]# cd /opt/hadoop-2.4.1-src/hadoop-dist/target/hadoop-2.4.1/bin
[root@cupcs-redhat6 bin]# ./hadoop version
Hadoop 2.4.1
Subversion Unknown -r Unknown
Compiled by root on 2014-08-07T05:52Z
Compiled with protoc 2.5.0
From source with checksum bb7ac0a3c73dc131f4844b873c74b630
This command was run using
/opt/hadoop-2.4.1-src/hadoop-dist/target/hadoop-2.4.1/share/hadoop/common/hadoop-common-2.4.1.jar
[root@cupcs-redhat6 bin]# cd ..
[root@cupcs-redhat6 hadoop-2.4.1]# 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
[root@cupcs-redhat6 hadoop-2.4.1]#

RedHat Ent 6.5 64bit编译安装hadoop2.4.1的更多相关文章

  1. 编译安装hadoop2.6.3

    一.安装环境 1.1  JAVA  安装java1.7 下载jdk1.7: [root@node1~]# wget http://download.oracle.com/otn-pub/java/jd ...

  2. 编译安装hadoop2.x

    1.Requirements: * Unix System * JDK 1.7+ * Maven 3.0 or later * Findbugs 1.3.9 (if running findbugs) ...

  3. CentOs64位编译安装hadoop-2.6.0

    官方提供的hadoop-2.x版本貌似都是32位的,在64位机子下使用可能会报错,最好使用官方提供的源码进行本地编译,编译成适合本地硬件环境的64位软件包. Hadoop是使用Java语言开发的,但是 ...

  4. [Ubuntu] Ubuntu14.04 64bit 编译安装nginx1.7+php5.4+mysql5.6

    我的操作系统是Ubuntu14.04,其它linux系统的操作流程类似. 主要安装的软件是nginx1.7+php5.4+mysql5.6 1. 创建必要目录 sudo mkdir ~/setup s ...

  5. Ubuntu14.04 64bit 编译安装nginx1.7+php5.4+mysql5.6

    我的操作系统是Ubuntu14.04,其它linux系统的操作流程类似. 主要安装的软件是nginx1.7+php5.4+mysql5.6 1. 创建必要目录 sudo mkdir ~/setup s ...

  6. CentOS 5 64bit 编译安装MySQL报错

    报错情况:   在执行./configure时出现configure: error: No curses/termcap library found 解决方法: ./configure时加上参数--w ...

  7. (转)CentOS 5.5 64bit 编译安装Adobe FlashMediaServer 3.5

    http://download.macromedia.com/pub/flashmediaserver/updates/4_0_2/Linux_32bit/FlashMediaServer4.tar. ...

  8. Hadoop第3周练习--Hadoop2.X编译安装和实验

    作业题目 位系统下进行本地编译的安装方式 选2 (1) 能否给web监控界面加上安全机制,怎样实现?抓图过程 (2)模拟namenode崩溃,例如将name目录的内容全部删除,然后通过secondar ...

  9. hadoop2.1.0编译安装教程

    由于现在hadoop2.0还处于beta版本,在apache官方网站上发布的beta版本中只有编译好的32bit可用,如果你直接下载安装在64bit的linux系统的机器上,运行会报一个INFO ut ...

随机推荐

  1. 实现toggleClass功能

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  2. 嵌入web字体

    @font-face模块         可以帮助我们轻松解决Web页面中使用优雅字体的方式,而且我们可以根据需要自定义多种字体,但是每个@font-face只能定义一种,若需要多个字体就启用多个@f ...

  3. mac 查看目前哪些进程占用哪些端口

    lsof -nP  | grep TCP | grep LISTEN lsof -i :TCP

  4. 基于vue单页应用的例子

    代码地址如下:http://www.demodashi.com/demo/13374.html 目录结构 src目录 主要的代码目录 components 存放项目组件 router 路由文件 sto ...

  5. EMQ 学习---订阅$SYS主题,捕获客户端上下线消息

    acl.config文件定义了可订阅$SYS主题的权限. {allow, {user, "dashboard"}, subscribe, ["$SYS/#"]} ...

  6. Shell 基础笔记

    1-22-shell脚本的基础 本节所讲内容:      shell 基本语法      变量 第1章 什么是SHELL?.. 2 1.1 shell编程.. 3 第2章 shell变量及运用.. ...

  7. 点滴积累【JS】---JS小功能(setInterval实现图片效果显示时间)

    效果: 代码: <head runat="server"> <title></title> <script type="text ...

  8. Sublime Text 2中自定义代码模板

    Sublime Text 2中自定义代码模板 2012-12-06 10:13 9921人阅读 评论(0) 收藏 举报  分类: 编辑器-Sublime Text 2(5)  版权声明:本文为博主原创 ...

  9. 实例探索Class文件

    class文件是指以.class为文件后缀的Java虚拟机可装载文件.无论该class文件是在linux上进行编译的,还是在windows环境下编译的,无论虚拟机是在何种平台下实现和运行的,class ...

  10. HDOJ 4884 & BestCoder#2 1002

    TIANKENG’s rice shop Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Oth ...