hadoop 3.2.1 在windows10源码编译

一、Hadoop

Hadoop是一个开源的大数据框架,是一个分布式计算的解决方案。

Hadoop的两个核心解决了数据存储问题(HDFS分布式文件系统)和分布式计算问题(MapRe-duce)。

 

二、Hadoop特点

 

1、支持超大文件。HDFS存储的文件可以支持TB和PB级别的数据。

2、高扩展性。可建构在廉价机上,实现线性(横向)扩展,当集群增加新节点之后,NameNode也可以感知,将数据分发和备份到相应的节点上。

 

 

正式开始,查看BUILDING.txt文件,查看环境依赖

1.BUILDING.txt


Building on Windowsjava


Requirements:git

  • Windows System
  • JDK 1.8
  • Maven 3.0 or later
  • ProtocolBuffer 2.5.0
  • CMake 3.1 or newer
  • Visual Studio 2010 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/downloadsgithub

If using Visual Studio, it must be Professional level or higher.
Do not use Visual Studio Express. It does not support compiling for 64-bit,
which is problematic if running a 64-bit system.web

The Windows SDK 8.1 is available to download at:apache

http://msdn.microsoft.com/en-us/windows/bg162891.aspxwindows

Cygwin is not required.bash


2. 实际安装以下:

(1)JDK 1.8 安装并设置环境变量
下载连接:https://www.oracle.com/java/technologies/javase-jdk8-downloads.html#license-lightbox
JAVA_HOME=JDK目录
CLASSPATH=.;%JAVA_HOME%\lib;%JAVA_HOME%\lib\jre\lib;
PATH添加 %JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;
检验以下:
在这里插入图片描述
(2)maven3.6.1 安装并设置环境变量
下载连接:https://archive.apache.org/dist/maven/maven-3/3.6.1/binaries/apache-maven-3.6.1-bin.zip
M2_HOME=maven安装目录
PATH添加 %M2_HOME%\bin
检验以下:
在这里插入图片描述
注意设置 settings,本地仓库路径,名称尽量短oracle

D:\\rep

(3)ProtocolBuffer 2.5.0安装并添加到环境变量
下载连接:https://github.com/protocolbuffers/protobuf/releases/download/v2.5.0/protoc-2.5.0-win32.zip
解压添加到PATH路径
检验以下:
在这里插入图片描述
(4)CMake安装并添加到环境变量
下载连接:https://github.com/Kitware/CMake/releases/download/v3.1.3/cmake-3.1.3-win32-x86.zip
将安装路径下bin目录添加到PATH路径
检验以下:
在这里插入图片描述
(5)git安装并设置环境变量
下载连接:https://github.com/git-for-windows/git/releases/download/v2.25.0.windows.1/Git-2.25.0-64-bit.exe
将安装路径下/usr/bin目录添加到PATH路径
hadoop 3.2.1 在windows10源码编译_第1张图片
(6) Zlib安装并设置环境变量
下载连接:http://www.zlib.net/fossils/zlib-1.2.5.tar.gz
解压,并设置ZLIB_HOME环境变量
(7)Visual Studio 2010 Professional 安装
 

3. Hadoop编译:

(1)将hadoop源码解压到根目录下 D:\h3s
(2)管理员打开cmd,执行命令,开始编译:

cd D:\myprogram\Microsoft Visual Studio 10.0\VC
vcvarsall.bat
cd D:\h3s
mvn clean package -Pdist,native-win -DskipTests -Dtar -Dmaven.javadoc.skip=true

(3)编译过程当中出现异常 ,cmake和MsBuild(MSB1009找不到)莫名报错,暂时在hadoop-hdfs-project\hadoop-hdfs-native-client\pom.xml中,屏蔽它们的错误

完毕

 

原文地址:

https://www.shangmayuan.com/a/ca89a8bb38fd4700a348d7e2.html

你可能感兴趣的:(技术人生,hadoop,java,大数据,linux,cmake)