本文主要记录Hadoop2.x在Ubuntu 12.04下编译源码的主要步骤和注意点: [一]、基础环境 Ubuntu 12.04 LTS 64? 位 Hadoop2.2.0 Java version: 1.7.0_55 Apache Maven 3.2.1 [二]、软件配置 1、更新apt 源 vi /et/apt/sources.list ,在文件末增加如下国内访
本文主要记录Hadoop2.x在Ubuntu 12.04下编译源码的主要步骤和注意点: [一]、基础环境vi /et/apt/sources.list
,在文件末增加如下国内访问比较快的源:
# 163 源 deb http://mirrors.163.com/ubuntu/ precise-updates main restricted deb-src http://mirrors.163.com/ubuntu/ precise-updates main restricted deb http://mirrors.163.com/ubuntu/ precise universe deb-src http://mirrors.163.com/ubuntu/ precise universe deb http://mirrors.163.com/ubuntu/ precise-updates universe deb-src http://mirrors.163.com/ubuntu/ precise-updates universe deb http://mirrors.163.com/ubuntu/ precise multiverse deb-src http://mirrors.163.com/ubuntu/ precise multiverse deb http://mirrors.163.com/ubuntu/ precise-updates multiverse deb-src http://mirrors.163.com/ubuntu/ precise-updates multiverse deb http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse # 中科大 deb http://mirrors.ustc.edu.cn/ubuntu/ precise-updates main restricted deb-src http://mirrors.ustc.edu.cn/ubuntu/ precise-updates main restricted deb http://mirrors.ustc.edu.cn/ubuntu/ precise universe deb-src http://mirrors.ustc.edu.cn/ubuntu/ precise universe deb http://mirrors.ustc.edu.cn/ubuntu/ precise-updates universe deb-src http://mirrors.ustc.edu.cn/ubuntu/ precise-updates universe deb http://mirrors.ustc.edu.cn/ubuntu/ precise multiverse deb-src http://mirrors.ustc.edu.cn/ubuntu/ precise multiverse deb http://mirrors.ustc.edu.cn/ubuntu/ precise-updates multiverse deb-src http://mirrors.ustc.edu.cn/ubuntu/ precise-updates multiverse deb http://mirrors.ustc.edu.cn/ubuntu/ precise-backports main restricted universe multiverse deb-src http://mirrors.ustc.edu.cn/ubuntu/ precise-backports main restricted universe multiverse # added by micmiu.com
sudo apt-get update sudo apt-get upgrade
#一次安装全部依赖的软件 sudo apt-get install g++ autoconf automake libtool cmake zlib1g-dev pkg-config libssl-dev
tar xzf protobuf-2.5.0.tar.gz cd protobuf-2.5.0/ ./configure --prefix=/usr make check make install
micmiu@ubuntu:~$ protoc --version libprotoc 2.5.0
./configure --prefix=/usr
[三]、Hadoop编译
下载源码:
svn co https://svn.apache.org/repos/asf/hadoop/common/tags/release-2.2.0 hadoop-release-2.2.0
org.mortbay.jetty jetty-util test
cd hadoop-release-2.2.0 mvn package -Pdist,native -DskipTests -Dtar
原文地址:Hadoop2.x在Ubuntu系统中编译源码, 感谢原作者分享。