准备工具:

maven 3.0.0版本或者更高版本(配置中心库)

protocbuff 2.5.0

http://www.zlib.net/

git bash(Windows环境可以用此工具执行编译命令)

下载源码:

http://hadoop.apache.org/releases.html

http://mirror.bit.edu.cn/apache/hadoop/common/

当前稳定版本为hadoop 2.9.2

编译源码:

在目录hadoop-maven-plugins下执行maven命令

mvn clean package -Pdist -DskipTests

mvn clean install -DskipTests

mvn clean install -Dmaven.test.skip=true

在目录hadoop-2.9.2-src下执行

mvn eclipse:eclipse -DskipTests

或者

mvn eclipse:eclipse -Dmaven.test.skip=true

然而编译到最后,挂红了、、 

定位如下:

原来是hadoop-aws工程报错。尝试注掉该工程(注释掉该工程,不影响正常阅读Hadoop源码):

重新编译:

共80个工程项目(hadoop-aws)失败

将Eclipse工程导入到IDEA,需要设置或更改M2_REPO和JDK版本(Hadoop 2.9.2使用JDK 1.7)

----------------------------------------------------------------------------------
Building on Windows
----------------------------------------------------------------------------------
Requirements:
* Windows System
* JDK 1.8
* Maven 3.0 or later
* ProtocolBuffer 2.5.
* CMake 3.1 or newer
* Visual Studio Professional or Higher
* Windows SDK 8.1 (if building CPU rate control for the container executor)
* zlib headers (if building native code bindings for zlib)
* Internet connection for first build (to fetch all Maven and Hadoop dependencies)
* Unix command-line tools from GnuWin32: sh, mkdir, rm, cp, tar, gzip. These
tools must be present on your PATH.
* Python ( for generation of docs using 'mvn site')
Unix command-line tools are also included with the Windows Git package which
can be downloaded from http://git-scm.com/downloads
If using Visual Studio, it must be Professional level or higher.
Do not use Visual Studio Express. It does not support compiling for -bit,
which is problematic if running a -bit system.
The Windows SDK 8.1 is available to download at:
http://msdn.microsoft.com/en-us/windows/bg162891.aspx
Cygwin is not required.
----------------------------------------------------------------------------------
Building:
Keep the source code tree in a short path to avoid running into problems related
to Windows maximum path length limitation (for example, C:\hdc).
There is one support command file located in dev-support called win-paths-eg.cmd.
It should be copied somewhere convenient and modified to fit your needs.
win-paths-eg.cmd sets up the environment for use. You will need to modify this
file. It will put all of the required components in the command path,
configure the bit-ness of the build, and set several optional components.
Several tests require that the user must have the Create Symbolic Links
privilege.
All Maven goals are the same as described above with the exception that
native code is built by enabling the 'native-win' Maven profile. -Pnative-win
is enabled by default when building on Windows since the native components
are required (not optional) on Windows.
If native code bindings for zlib are required, then the zlib headers must be
deployed on the build machine. Set the ZLIB_HOME environment variable to the
directory containing the headers.
set ZLIB_HOME=C:\zlib-1.2.
At runtime, zlib1.dll must be accessible on the PATH. Hadoop has been tested
with zlib 1.2., built using Visual Studio out of contrib\vstudio\vc10 in
the zlib 1.2. source tree.
http://www.zlib.net/
----------------------------------------------------------------------------------
Building distributions:
* Build distribution with native code : mvn package [-Pdist][-Pdocs][-Psrc][-Dtar][-Dmaven.javadoc.skip=true]
----------------------------------------------------------------------------------
Running compatibility checks with checkcompatibility.py
Invoke `./dev-support/bin/checkcompatibility.py` to run Java API Compliance Checker
to compare the public Java APIs of two git objects. This can be used by release
managers to compare the compatibility of a previous and current release.
As an example, this invocation will check the compatibility of interfaces annotated as Public or LimitedPrivate:
./dev-support/bin/checkcompatibility.py --annotation org.apache.hadoop.classification.InterfaceAudience.Public --annotation org.apache.hadoop.classification.InterfaceAudience.LimitedPrivate --include "hadoop.*" branch-2.7. trunk
----------------------------------------------------------------------------------
Changing the Hadoop version declared returned by VersionInfo
If for compatibility reasons the version of Hadoop has to be declared as a .x release in the information returned by
org.apache.hadoop.util.VersionInfo, set the property declared.hadoop.version to the desired version.
For example: mvn package -Pdist -Ddeclared.hadoop.version=2.11
If unset, the project version declared in the POM file is used. ----------------------------------------------------------------------------------
Building distributions:
Create binary distribution without native code and without documentation:
$ mvn package -Pdist -DskipTests -Dtar -Dmaven.javadoc.skip=true
Create binary distribution with native code and with documentation:
$ mvn package -Pdist,native,docs -DskipTests -Dtar
Create source distribution:
$ mvn package -Psrc -DskipTests
Create source and binary distributions with native code and documentation:
$ mvn package -Pdist,native,docs,src -DskipTests -Dtar
Create a local staging version of the website (in /tmp/hadoop-site)
$ mvn clean site -Preleasedocs; mvn site:stage -DstagingDirectory=/tmp/hadoop-site
----------------------------------------------------------------------------------
Installing Hadoop
Look for these HTML files after you build the document by the above commands.
* Single Node Setup:
hadoop-project-dist/hadoop-common/SingleCluster.html
* Cluster Setup:
hadoop-project-dist/hadoop-common/ClusterSetup.html

README

 

Hadoop源码编译环境搭建的更多相关文章

  1. Hadoop源码阅读环境搭建(IDEA)

    拿到一份Hadoop源码之后,经常关注的两件事情就是 1.怎么阅读?涉及IDEA和Eclipse工程搭建.IDEA搭建,选择源码,逐步导入即可:Eclipse可以选择后台生成工程,也可以选择IDE导入 ...

  2. hadoop源码eclipse环境搭建-源码获取阶段

    就目前了解,结合eclipse阅读和编译hadoop源码用两种方式:svn和git. 根据官方指南http://wiki.apache.org/hadoop/EclipseEnvironment 推荐 ...

  3. ffmpeg源码编译环境搭建

    ffmpeg是视频开发最常用到的开源软件,FFmpeg功能强大,用途广泛,提供几乎所有你能够想到的与视频开发相关的操作,许多商业软件都以ffmpeg为基础进行开发定制. FFmpeg: FFmpeg ...

  4. android 5.0 (lollipop)源码编译环境搭建(Mac OS X)

    硬件环境:MacBook Pro Retina, 13-inch, Late 2013 处理器  2.4 GHz Intel Core i5 内存  8 GB 1600 MHz DDR3 硬盘60G以 ...

  5. Android 源码编译环境搭建(64位Ubuntu)各种依赖包安装

    1.准备: 普通PC(要求能上网), PC的操作系统Ubuntu 10.04 LTS(64位的),已经下载好的Android 1.6_r1的源代码. 2.Linux的依赖package安装: 为了更快 ...

  6. Jmeter3.2源码编译环境搭建

    1.下载jmeter3.2源码 https://github.com/apache/jmeter/tree/v3_2 https://blog.csdn.net/fly_to_higher/artic ...

  7. Jmeter3.2源码编译环境搭建(转)

    1.下载jmeter3.2源码 https://github.com/apache/jmeter/tree/v3_2 https://blog.csdn.net/fly_to_higher/artic ...

  8. 【转】Linux(ubuntu14.04)上编译Android4.4源码的环境搭建及编译全过程

    原文网址:http://jileniao.net/linux-android-building.html sublime text让我伤心.本来很信任sublime text的自动保存功能,之前使用一 ...

  9. Mac搭建Hadoop源码阅读环境

    1.本次Hadoop源码阅读环境使用的阅读工具是idea,Hadoop版本是2.7.3.需要安装的工具包括idea.jdk.maven.protobuf等 2.jdk,使用的版本是1.8版,在jdk官 ...

随机推荐

  1. vue async/await同步 案例

    1.async/await场景 这是一个用同步的思维来解决异步问题的方案,当前端接口调用需要等到接口返回值以后渲染页面时. 2.名词解释 >async async的用法,它作为一个关键字放到函数 ...

  2. chrome://命令

    一些常用的命令: chrome://version 显示当前版本 chrome://flags 实验项目,加“#项目名称”锚点可以直接定位到项目 chrome://settings 设置,下图是设置定 ...

  3. MySQL插入emoji表情失败问题的解决方法

    前言 之前一直认为UTF-8是万能的字符集问题解决方案,直到最近遇到这个问题.最近在做新浪微博的爬虫, 在存库的时候发现只要保持emoji表情,就回抛出以下异常: Incorrect string v ...

  4. Kubernetes介绍

    Kubernetes介绍 一.Kubernetes起源 Kubernetes (K8s) 是 Google 在 2014 年发布的一个开源项目.   据说 Google 的数据中心里运行着超过 20 ...

  5. Tensorflow-slim 学习笔记(一)概述

    TF-Slim的优势:slim作为一种轻量级的tensorflow库,使得模型的构建,训练,测试都变得更加简单. 1. 使用方法: import tensorflow.contrib.slim as ...

  6. 你知道CAN/RS-485总线为什么要隔离吗?

    您在使用CAN或RS-485总线进行调试时,是否遇到过偶尔通信出错?或者接收不到数据?一直正常使用的总线,突然出现大范围的错误,或者节点损坏?您还在为这些问题不知所措,摸不着头脑吗?使用总线隔离,或许 ...

  7. java crm 进销存 springmvc SSM 项目 源码 系统

    系统介绍: 1.系统采用主流的 SSM 框架 jsp JSTL bootstrap html5 (PC浏览器使用) 2.springmvc +spring4.3.7+ mybaits3.3  SSM ...

  8. 第一次码java感想及前三次作业总结

    写在前面 嗯,首先是java,这学期第一次oo作业布置下来的周末才开始看的,第一次作业因此写得有些手忙脚乱.不过大概看了一遍后发现比c好用,入门更简单吧,好多操作直接import一下就能用了,码代码的 ...

  9. elasticsearch 请求体查询方式整理

    空查询(empty search) —{}— 在功能上等价于使用 match_all 查询, 正如其名字一样,匹配所有文档: GET /_search { "query": { & ...

  10. adb devices报错解决

    1. 执行adb device报错如下 2. 报错原因及解决办法 报错时开启了Androidkiller,关闭即解决问题 可能原因:adb命令被占用冲突了