Hadoop源码编译⽀持snappy压缩Hadoop 源码编译⽀持 snappy 压缩
1.下载安装包
centos7x64
jdk1.8.0_181
apache-maven-3.3.9
protobuf-2.5.
apache-ant-1.9.13-bin.zip
hadoop-2.7.
snappy-1.1.
2.提前配置环境变量
vim /etc/profile
-
-------------------------------------------------
BASE_DIR=/opt/softwares
export BASE_DIR
export JAVA_HOME=$BASE_DIR/jdk1.8.0_181
export PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/sbin
MAVEN_HOME=$BASE_DIR/apache-maven-3.3.9
MAVEN_OPTS="-Xms1024m -Xmx2048m -Xss36m -XX:MaxPermSize=512m"
PATH=$PATH:$MAVEN_HOME/bin
export MAVEN_HOME MAVEN_OPTS PATH
ANT_HOME=$BASE_DIR/apache-ant-1.9.13
PATH=$PATH:$ANT_HOME/bin
export ANT_HOME PATH
LD_LIBRARY_PATH=$BASE_DIR/protobuf-2.5.0
PATH=$PATH:$LD_LIBRARY_PATH/bin
export LD_LIBRARY_PATH PATH
export SCALA_HOME PATH
--------------------------------------------------
source /etc/profile
3.编译环境准备
# 宿主机与虚拟机传递⽂件⼯具
yum install -y nmap-ncat
# 发送端
nc maven 4000 < hadoop-2.7.
# 接受端 先关闭防⽕墙
systemctl stop iptables
systemctl stop firewalld
chkconfig disable chkconfig
chkconfig disable firewalld
nc -l 4000 > hadoop-2.7.
# 安装编译环境 gcc make ...
yum install glibc-headers gcc-c++ make cmake openssl-devel  ncurses-devel # 安装 ant 打包⼯具编译环境
tar -zxvf apache-ant-1.9.13-bin.zip -C /opt/softwares
# 已经提前配置好环境变量,直接检测
[root@maven target]# ant -v
Apache Ant(TM) version 1.9.13 compiled on July 10 2018 《》
Trying the default build file: l
Buildfile: l does not exist!
Build failed
# 安装protobuf编译环境
tar -zxvf protobuf-2.5. -C /opt/softwares
cd /opt/softwares/protobuf-2.5.0
[root@maven target]# protoc --version
libprotoc 2.5.0
# 安装 snappy lib 库
tar -zxvf snappy-1.1. -C /opt/softwares
cd /opt/softwares/snappy-1.1.3
./configure
make && make install
[root@maven target]# ls /usr/local/lib | grep snappy
libsnappy.a
libsnappy.la
libsnappy.so
libsnappy.so.1
libsnappy.so.1.3.0
# maven 配置镜像仓库
# 解压maven官⽹基础镜像到本地
tar -zxvf /opt/softwares/apache-maven-3.3.9
# 配置本地仓库和远程镜像仓库
vim /opt/softwares/apache-maven-3.3.9/l
-----------------------------------------------------------------------------------
...
<localRepository>/Users/huhao/apache-maven-3.3.9/repository</localRepository> <mirrors>
<mirror>
<id>aliyun-repo</id>
<name>阿⾥云</name>
<mirrorOf>central</mirrorOf>
</mirror>
<name>cn 管仓</name>
<mirrorOf>central</mirrorOf> </mirror>
<mirror>
<id>maven2-repo</id>
<name>maven2管仓</name>    <mirrorOf>central</mirrorOf> </mirror>
<mirror>
<id>jboss2-repo</id>
<name>jboss 管仓</name>
<mirrorOf>central</mirrorOf> </mirror>
<mirror>
<id>mvnrepository-repo</id>    <name>管仓推荐1</name>
<mirrorOf>central</mirrorOf> </mirror>
<mirror>
<id>mvnrepository-repo2</id>    <name>管仓推荐2</name>
ant安装包<mirrorOf>central</mirrorOf> </mirror>
<mirror>
<id>jboss-repo</id>
<name>jboss仓库</name>
<mirrorOf>central</mirrorOf>
<id>ibiblio-repo</id>
<name>ibiblio仓库</name>
<mirrorOf>central</mirrorOf> </mirror>
<mirror>
<id>antelink-repo</id>
<name>antelink 仓库</name>
<mirrorOf>central</mirrorOf> </mirror>
<mirror>
<id>openkoala-repo</id>
<name>openkoala 仓库</name>    <mirrorOf>central</mirrorOf> </mirror>
<mirror>
<id>cloudera-repo</id>
<name>cloudera</name>
<mirrorOf>central</mirrorOf> </mirror>
<mirror>
<id>tmatesoft-repo</id>
<name>tmatesoft 仓库</name>    <mirrorOf>central</mirrorOf> </mirror>
<mirror>
<id>maven-2-repo</id>
<name>maven</name>

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。