Debian/Ubuntu编译多版本Hadoop及踩坑

本文介绍了如何在Debian/Ubuntu系统上为Hadoop的2.6.0、3.2.1和3.3.0版本配置编译环境,包括JDK、Maven、Protocol Buffers等依赖的安装。在编译过程中遇到的OpenSSL版本、GCC版本、protoc版本和JDK版本问题,提供了相应的解决办法。
摘要由CSDN通过智能技术生成

最近在搭建Jenkins+Git的CI/CD流程,公司用到了Hadoop的好几个版本,2.6.0、3.2.1、3.3.0,这三个版本对编译环境的要求都有不同,所以以下是我在一台机器搭建三个版本的Hadoop编译环境的过程。

hadoop3.3 Requirements

首先看BUILDING.txt(https://github.com/apache/hadoop/blob/trunk/BUILDING.txt),这里先以3.3版本为准

Requirements:

  • 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)
相关工具的安装

1、安装JDK1.7/JDK1.8(Hadoop2用JDK1.7,Hadoop3用JDK1.8)
2、安装maven
3、Native libraries:

sudo apt-get -y install build-essential autoconf automake libtool cmake zlib1g-dev pkg-config libssl-dev libsasl2-dev

4、安装Protocol Buffers(2.5.0版本和3.7.1版本)
通过export HADOOP_PROTOC_PATH指定编译时使用的protoc版本

安装protoc2.5.0:
下载压缩包,上传到机器,解压

cd /home/hadoop/protobuf-2.5.0
./configure --prefix=/usr/local/protobuf-2.5.0
make && make install

安装protoc3.7.1:
下载压缩包,上传到机器,解压

cd /home/hadoop/protobuf-3.7.1
sh autogen.sh
./configure --prefix=/usr/local
make && make in
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值