hadoop编译native包

hadoop编译native包

hadoop源码包
http://mirrors.hust.edu.cn/apache/hadoop/common

protobuf(用于编译生成hadoop的native包,这个百度很多)

centos下:

yum -y install lzo-devel zlib-devel gcc autoconf automake libtool
安装g++:yum -y install gcc-c++
安装cmake:yum -y install cmake
安装openssl-devel:yum -y install openssl-devel

进入下载的protobuf文件夹下
./configure
make
make install

进入hadoop-2.x.x-src编译hadoop
mvn clean package -Pdist,native -DskipTests -Dtar

native包在
hadoop-2.x.x-src/hadoop-dist/target/hadoop-2.x.x/lib/native

在/etc/profile添加
export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
export HADOOP_OPTS="-Djava.library.path=$HADOOP_HOME/lib:$HADOOP_COMMON_LIB_NATIVE_DIR"

你可能感兴趣的:(hadoop编译native包)