欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

Mac上使用Hadoop 3.3.6源码构建的步骤及常见问题解决方法-3. 准备环境

最编程 2024-01-21 11:31:06
...

解压后的源码导入idea 在根目录下 有个BUILDING.txt
我们直接参考这个编译

  • Unix System
  • JDK 1.8 (最好是)
  • Maven 3.3 or later
  • Protocol Buffers 3.7.1 (if compiling native code)
  • CMake 3.1 or newer (if compiling native code)
  • Zlib devel (if compiling native code)
  • Cyrus SASL devel (if compiling native code)
  • One of the compilers that support thread_local storage: GCC 4.8.1 or later, Visual Studio,
    Clang (community version), Clang (version for iOS 9 and later) (if compiling native code)
  • openssl devel (if compiling native hadoop-pipes and to get the best HDFS encryption performance)
  • Linux FUSE (Filesystem in Userspace) version 2.6 or above (if compiling fuse_dfs)
  • Doxygen ( if compiling libhdfspp and generating the documents )
  • Internet connection for first build (to fetch all Maven and Hadoop dependencies)
  • python (for releasedocs)
  • bats (for shell code testing)
  • Node.js / bower / Ember-cli (for YARN UI v2 building)

因为我们要编译native源码 所以 标记 if compiling native code 这个都需要安装
可以直接使用homebrew来安装 但是需要注意强调的版本

Building on macOS (without Docker)


Installing required dependencies for clean install of macOS 10.14:

  • Install Xcode Command Line Tools
    $ xcode-select --install
  • Install Homebrew
    $ /usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
  • Install OpenJDK 8
    $ brew tap AdoptOpenJDK/openjdk
    $ brew cask install adoptopenjdk8
  • Install maven and tools
    $ brew install maven autoconf automake cmake wget
  • Install native libraries, only openssl is required to compile native code,
    you may optionally install zlib, lz4, etc.
    $ brew install openssl
  • Protocol Buffers 3.7.1 (required to compile native code)
    $ wget https://github.com/protocolbuffers/protobuf/releases/download/v3.7.1/protobuf-java-3.7.1.tar.gz
    $ mkdir -p protobuf-3.7 && tar zxvf protobuf-java-3.7.1.tar.gz --strip-components 1 -C protobuf-3.7
    $ cd protobuf-3.7
    $ ./configure
    $ make
    $ make check
    $ make install
    $ protoc --version

Note that building Hadoop 3.1.1/3.1.2/3.2.0 native code from source is broken
on macOS. For 3.1.1/3.1.2, you need to manually backport YARN-8622. For 3.2.0,
you need to backport both YARN-8622 and YARN-9487 in order to build native code.