准备工具:

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. springMVC參数传递

    本文是本人在学习网络视屏springMVC的过程中的学习笔记. 为了更便于理解我决定从实际使用的角度解释. 我们在浏览器输入地址 http://localhost:8080/springMVC6/us ...

  2. 1051. [HAOI2006]受欢迎的牛【强连通分量】

    Description 每一头牛的愿望就是变成一头最受欢迎的牛.现在有N头牛,给你M对整数(A,B),表示牛A认为牛B受欢迎. 这 种关系是具有传递性的,如果A认为B受欢迎,B认为C受欢迎,那么牛A也 ...

  3. DevOps 解读

    本文为 转载文章, 非原创 DevOps DevOps(Development和Operations的组合词)是一种重视“软件开发人员(Dev)”和“IT运维技术人员(Ops)”之间沟通合作的文化.运 ...

  4. openfalcon-0.2 配置

    hbs 配置文件 { "debug": true, "database": "openfalcon:123456@tcp(172.16.230.188 ...

  5. PAT乙级1001

    https://pintia.cn/problem-sets/994805260223102976/problems/994805325918486528 #include<bits/stdc+ ...

  6. 《数据结构算法分析C描述》引论:选择问题,字谜游戏问题

    #include <stdio.h> #include <stdlib.h> // 第一题 // 找出N个数的第k个最大者 // 方法1:排序(冒泡),降序找出第k个值 // ...

  7. Oracle ora-12514监听程序当前无法识别连接描述中请求的错误

    昨天刚安装好oracle数据库,还可以登录,到今天,登录时就发出了这样的错误 到网上找了半天,上面都是说监听器服务的问题,但是试过后依旧不行.最后重启了一次,就解决了异常 原来是oracle中一个服务 ...

  8. javascript中的属性注意事项

    1.函数原型prototype设置的对象是只读类型,所以不能修改(即栈只读).但是我们常常可以看到它被“修改‘’了.若对象中定义的属性和原型中属性一样,优先使用自定义属性. 例如代码: //原型 类似 ...

  9. #leetcode刷题之路34-在排序数组中查找元素的第一个和最后一个位置

    给定一个按照升序排列的整数数组 nums,和一个目标值 target.找出给定目标值在数组中的开始位置和结束位置.你的算法时间复杂度必须是 O(log n) 级别.如果数组中不存在目标值,返回 [-1 ...

  10. 【OS X系统】Xcode中搭建Python环境。

    虽然按照网上教程一步一步来,但还是遇到了几个错误点,现整理出来,主要是自己做个笔记,同时也希望能帮助到其他像我一样第一次在Xcode上搭建Python环境的人.首先感谢原作者:https://zhid ...