编译hadoop2.7.7源码

安装protobuf

protobuf下载地址:https://github.com/protocolbuffers/protobuf/releases/tag/v2.5.0

1.解压protobuf

tar -zxvf protobuf-2.5.0.tar.gz

2.安装依赖

yum install -y gcc gcc-c++ make cmake
yum install -y autoconf automake libtool curl make g++

3.编译protobuf

cd protobuf-2.5.0
./configure --prefix=/Users/pengjianbo/dev/tools/protobuf-2.5.0/
make & make install

4.设置环境变量

vi /etc/profile

export PROTOC_HOME=/home/hadoop/app/protobuf
export PATH=$PROTOC_HOME/bin:$PATH

source /etc/profile

5.测试

protoc  --version

编译hadoop源码

1.下载hadoop源码

wget https://archive.apache.org/dist/hadoop/common/hadoop-2.7.7/hadoop-2.7.7-src.tar.gz

2.编译hadoop

mvn clean package -DskipTests -Pdist,native -Dtar -Dsnappy.lib=/opt/ -Dbundle.snappy
如果觉得我的文章对你有用,请随意赞赏