阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

CentOS 64位上编译 Hadoop 2.6.0

276次阅读
没有评论

共计 8414 个字符,预计需要花费 22 分钟才能阅读完成。

Hadoop 不提供 64 位编译好的版本,只能用源码自行编译 64 位版本。学习一项技术从安装开始,学习 hadoop 要从编译开始。

1. 操作系统编译环境

yum install cmake lzo-devel zlib-devel gcc gcc-c++ autoconf automake libtool ncurses-devel openssl-devel libXtst

2. 安装 JDK

下载 JDK1.7,注意只能用 1.7,否则编译会出错
http://www.Oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

tar zxvf jdk-7u75-linux-x64.tar.gz -C /app

export JAVA_HOME=/app/jdk1.7.0_75
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

PATH=$PATH:$JAVA_HOME/bin

3. 安装 protobuf

下载 protobuf-2.5.0,不能用高版本,否则 Hadoop 编译不能通过
wget https://protobuf.googlecode.com/files/protobuf-2.5.0.tar.gz

tar xvf protobuf-2.5.0.tar.gz
cd protobuf-2.5.0
./configure
make
make install
ldconfig

protoc –version

4. 安装 ANT

wget http://mirror.bit.edu.cn/apache/ant/binaries/apache-ant-1.9.4-bin.tar.gz
 tar zxvf apache-ant-1.9.4-bin.tar.gz -C /app

vi /etc/profile
export ANT_HOME=/app/apache-ant-1.9.4
PATH=$PATH:$ANT_HOME/bin

5. 安装 maven

wget http://mirror.bit.edu.cn/apache/maven/maven-3/3.3.1/binaries/apache-maven-3.3.1-bin.tar.gz

tar zxvf apache-maven-3.3.1-bin.tar.gz -C /app

vi /etc/profile
export MAVEN_HOME=/app/apache-maven-3.3.1
export PATH=$PATH:$MAVEN_HOME/bin

修改配置文件
vi /app/apache-maven-3.3.1/conf/settings.xml

更改 maven 资料库,在 <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>

6. 安装 findbugs(非必须)
wget http://prdownloads.sourceforge.net/findbugs/findbugs-3.0.1.tar.gz?download
tar zxvf findbugs-3.0.1.tar.gz -C /app

vi /etc/profile
export FINDBUGS_HOME=/app/findbugs-3.0.1
PATH=$PATH:$FINDBUGS_HOME/bin
export PATH

注意:
最终,在 /etc/profile 中环境变量 PATH 的设置如下:
PATH=$PATH:$JAVA_HOME/bin:$ANT_HOME/bin:$MAVEN_HOME/bin:$FINDBUGS_HOME/bin
export PATH

在 shell 下执行,使环境变量生效
. /etc/profile

7. 编译 Hadoop2.6.0

wget http://mirror.bit.edu.cn/apache/hadoop/core/hadoop-2.6.0/hadoop-2.6.0-src.tar.gz
cd hadoop-2.6.0-src
mvn package -DskipTests -Pdist,native -Dtar

[INFO] Reactor Summary:
[INFO]
[INFO] Apache Hadoop Main …………………………… SUCCESS [4.401 s]
[INFO] Apache Hadoop Project POM …………………….. SUCCESS [3.864 s]
[INFO] Apache Hadoop Annotations …………………….. SUCCESS [7.591 s]
[INFO] Apache Hadoop Assemblies ……………………… SUCCESS [0.535 s]
[INFO] Apache Hadoop Project Dist POM ………………… SUCCESS [3.585 s]
[INFO] Apache Hadoop Maven Plugins …………………… SUCCESS [6.623 s]
[INFO] Apache Hadoop MiniKDC ………………………… SUCCESS [4.722 s]
[INFO] Apache Hadoop Auth …………………………… SUCCESS [7.787 s]
[INFO] Apache Hadoop Auth Examples …………………… SUCCESS [5.500 s]
[INFO] Apache Hadoop Common …………………………. SUCCESS [02:47 min]
[INFO] Apache Hadoop NFS ……………………………. SUCCESS [12.793 s]
[INFO] Apache Hadoop KMS ……………………………. SUCCESS [20.443 s]
[INFO] Apache Hadoop Common Project ………………….. SUCCESS [0.111 s]
[INFO] Apache Hadoop HDFS …………………………… SUCCESS [04:35 min]
[INFO] Apache Hadoop HttpFS …………………………. SUCCESS [29.896 s]
[INFO] Apache Hadoop HDFS BookKeeper Journal ………….. SUCCESS [11.100 s]
[INFO] Apache Hadoop HDFS-NFS ……………………….. SUCCESS [8.262 s]
[INFO] Apache Hadoop HDFS Project ……………………. SUCCESS [0.069 s]
[INFO] hadoop-yarn …………………………………. SUCCESS [0.066 s]
[INFO] hadoop-yarn-api ……………………………… SUCCESS [02:05 min]
[INFO] hadoop-yarn-common …………………………… SUCCESS [46.132 s]
[INFO] hadoop-yarn-server …………………………… SUCCESS [0.123 s]
[INFO] hadoop-yarn-server-common …………………….. SUCCESS [19.166 s]
[INFO] hadoop-yarn-server-nodemanager ………………… SUCCESS [25.552 s]
[INFO] hadoop-yarn-server-web-proxy ………………….. SUCCESS [5.456 s]
[INFO] hadoop-yarn-server-applicationhistoryservice ……. SUCCESS [11.781 s]
[INFO] hadoop-yarn-server-resourcemanager …………….. SUCCESS [30.557 s]
[INFO] hadoop-yarn-server-tests ……………………… SUCCESS [9.765 s]
[INFO] hadoop-yarn-client …………………………… SUCCESS [14.016 s]
[INFO] hadoop-yarn-applications ……………………… SUCCESS [0.101 s]
[INFO] hadoop-yarn-applications-distributedshell ………. SUCCESS [4.116 s]
[INFO] hadoop-yarn-applications-unmanaged-am-launcher ….. SUCCESS [2.993 s]
[INFO] hadoop-yarn-site …………………………….. SUCCESS [0.093 s]
[INFO] hadoop-yarn-registry …………………………. SUCCESS [9.036 s]
[INFO] hadoop-yarn-project ………………………….. SUCCESS [6.557 s]
[INFO] hadoop-mapreduce-client ………………………. SUCCESS [0.267 s]
[INFO] hadoop-mapreduce-client-core ………………….. SUCCESS [36.775 s]
[INFO] hadoop-mapreduce-client-common ………………… SUCCESS [28.049 s]
[INFO] hadoop-mapreduce-client-shuffle ……………….. SUCCESS [7.285 s]
[INFO] hadoop-mapreduce-client-app …………………… SUCCESS [17.333 s]
[INFO] hadoop-mapreduce-client-hs ……………………. SUCCESS [15.283 s]
[INFO] hadoop-mapreduce-client-jobclient ……………… SUCCESS [7.110 s]
[INFO] hadoop-mapreduce-client-hs-plugins …………….. SUCCESS [3.843 s]
[INFO] Apache Hadoop MapReduce Examples ………………. SUCCESS [12.559 s]
[INFO] hadoop-mapreduce …………………………….. SUCCESS [6.331 s]
[INFO] Apache Hadoop MapReduce Streaming ……………… SUCCESS [45.863 s]
[INFO] Apache Hadoop Distributed Copy ………………… SUCCESS [46.304 s]
[INFO] Apache Hadoop Archives ……………………….. SUCCESS [3.575 s]
[INFO] Apache Hadoop Rumen ………………………….. SUCCESS [12.991 s]
[INFO] Apache Hadoop Gridmix ………………………… SUCCESS [10.105 s]
[INFO] Apache Hadoop Data Join ………………………. SUCCESS [5.021 s]
[INFO] Apache Hadoop Ant Tasks ………………………. SUCCESS [3.804 s]
[INFO] Apache Hadoop Extras …………………………. SUCCESS [5.298 s]
[INFO] Apache Hadoop Pipes ………………………….. SUCCESS [10.290 s]
[INFO] Apache Hadoop OpenStack support ……………….. SUCCESS [9.220 s]
[INFO] Apache Hadoop Amazon Web Services support ………. SUCCESS [11:12 min]
[INFO] Apache Hadoop Client …………………………. SUCCESS [10.714 s]
[INFO] Apache Hadoop Mini-Cluster ……………………. SUCCESS [0.143 s]
[INFO] Apache Hadoop Scheduler Load Simulator …………. SUCCESS [7.664 s]
[INFO] Apache Hadoop Tools Dist ……………………… SUCCESS [29.970 s]
[INFO] Apache Hadoop Tools ………………………….. SUCCESS [0.057 s]
[INFO] Apache Hadoop Distribution ……………………. SUCCESS [49.425 s]
[INFO] ————————————————————————
[INFO] BUILD SUCCESS
[INFO] ————————————————————————
[INFO] Total time: 32:26 min
[INFO] Finished at: 2015-03-19T19:56:40+08:00
[INFO] Final Memory: 99M/298M
[INFO] ————————————————————————

编译成功后会打包,放在 hadoop-dist/target
# ls
antrun                    dist-tar-stitching.sh  hadoop-2.6.0.tar.gz    hadoop-dist-2.6.0-javadoc.jar  maven-archiver
dist-layout-stitching.sh  hadoop-2.6.0          hadoop-dist-2.6.0.jar  javadoc-bundle-options        test-dir

————————————– 分割线 ————————————–

Ubuntu14.04 下 Hadoop2.4.1 单机 / 伪分布式安装配置教程  http://www.linuxidc.com/Linux/2015-02/113487.htm

CentOS 安装和配置 Hadoop2.2.0  http://www.linuxidc.com/Linux/2014-01/94685.htm

Ubuntu 13.04 上搭建 Hadoop 环境 http://www.linuxidc.com/Linux/2013-06/86106.htm

Ubuntu 12.10 +Hadoop 1.2.1 版本集群配置 http://www.linuxidc.com/Linux/2013-09/90600.htm

Ubuntu 上搭建 Hadoop 环境(单机模式 + 伪分布模式)http://www.linuxidc.com/Linux/2013-01/77681.htm

Ubuntu 下 Hadoop 环境的配置 http://www.linuxidc.com/Linux/2012-11/74539.htm

单机版搭建 Hadoop 环境图文教程详解 http://www.linuxidc.com/Linux/2012-02/53927.htm

搭建 Hadoop 环境(在 Winodws 环境下用虚拟机虚拟两个 Ubuntu 系

更多 Hadoop 相关信息见 Hadoop 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=13

本文永久更新链接地址 :http://www.linuxidc.com/Linux/2015-03/115272.htm

正文完
星哥玩云-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2022-01-20发表,共计8414字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中