赞
踩
一、Maven环境搭建
tar -zxvf apache-maven-3.6.3-bin.tar.gz -C /opt/module/
mv apache-maven-3.6.3-bin maven-3.6.3
sudo vi /etc/profile.d/my_env.sh
#MAVEN_HOME
export MAVEN_HOME=/opt/module/apache-maven-3.6.3
export PATH=$PATH:$MAVEN_HOME/bin
cd /opt/software/maven-3.6.3/conf vi settings.xml <mirrors> <mirror> <id>nexus-aliyun</id> <mirrorOf>central</mirrorOf> <name>Nexus aliyun</name> <url>http://maven.aliyun.com/nexus/content/groups/public</url> </mirror> <mirror> <id>CN</id> <name>OSChina Central</name> <url>http://maven.oschina.net/content/groups/public/</url> <mirrorOf>central</mirrorOf> </mirror> <mirror> <id>alimaven</id> <mirrorOf>central</mirrorOf> <name>aliyun maven</name> <url>https://maven.aliyun.com/nexus/content/repositories/central/</url> </mirror> <mirror> <id>jboss-public-repository-group</id> <mirrorOf>central</mirrorOf> <name>JBoss Public Repository Group</name> <url>https://repository.jboss.org/nexus/content/groups/public</url> </mirror> </mirrors>
yum install -y git
yum -y install gcc-c++ lzo-devel zlib-devel autoconf automake libtool
二、 lzo的下载、安装并编译
tar -zxvf lzo-2.10.tar.gz -C /opt/module/
cd lzo-2.10
#注意切换用户为root
./configure -prefix=/usr/local/hadoop/lzo/
make
make install
1、下载地址:
https://github.com/twitter/hadoop-lzo/archive/master.zip
2、解压并编辑,并修改版本为下述值
vi pom.xml
编辑内容:
<hadoop.current.version>3.1.3</hadoop.current.version>
3、增加临时变量
sudo vi /etc/profile
编辑内容:
export C_INCLUDE_PATH=/usr/local/hadoop/lzo/include
export LIBRARY_PATH=/usr/local/hadoop/lzo/lib
4、编译
mvn package -Dmaven.test.skip=true
1、进入target目录,hadoop-lzo-0.4.21-SNAPSHOT.jar 即编译成功的hadoop-lzo组件 2、将编译好后的hadoop-lzo-0.4.20.jar 放入hadoop-3.1.3/share/hadoop/common/ cd /opt/module/hadoop-3.1.3/share/hadoop/common 3、同步hadoop-lzo-0.4.21-SNAPSHOT.jar到hadoop102、hadoop103 [yili@hadoop102 common]$ xsync.sh hadoop-lzo-0.4.21-SNAPSHOT.jar 4、core-site.xml增加配置支持LZO压缩 <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <configuration> <property> <name>io.compression.codecs</name> <value> org.apache.hadoop.io.compress.GzipCodec, org.apache.hadoop.io.compress.DefaultCodec, org.apache.hadoop.io.compress.BZip2Codec, org.apache.hadoop.io.compress.SnappyCodec, com.hadoop.compression.lzo.LzoCodec, com.hadoop.compression.lzo.LzopCodec </value> </property> <property> <name>io.compression.codec.lzo.class</name> <value>com.hadoop.compression.lzo.LzoCodec</value> </property> </configuration> 5、同步core-site.xml到hadoop102、hadoop103 [yili@hadoop102 hadoop]$ xsync.sh core-site.xml 6、启动集群 [yili@hadoop102 bin]$ ./cluster.sh start
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。