hadoop 自编译(Linux)
2021/12/30 7:10:49
本文主要是介绍hadoop 自编译(Linux),对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
-
准备JDK,maven,ant,protobuf, hadoop 源码包
-
下载包链接: https://pan.baidu.com/s/1a16hxPheMdm99g01yZvjSw?pwd=rzm9 提取码: rzm9
-
上传包到Linux 中
-
解压安装 JDK,Maven,ant
tar -zxvf jdk-8u301-linux-x64.tar.gz mv jdk1.8.0_301/ /usr/local/ tar -zxvf apache-maven-3.6.3-bin.tar.gz mv apache-maven-3.6.3/ /usr/local/ tar -zvf apache-ant-1.10.7-bin.tar.gz mv apache-ant-1.10.7/ /usr/local/
-
配置环境变量(vi /etc/profile)
#JAVA_HOME export JAVA_HOME=/usr/local/jdk1.8.0_301 export PATH=$PATH:$JAVA_HOME/bin #MAVEN_HOM export MAVEN_HOME=/usr/local/apache-maven-3.6.3 export PATH=$PATH:$MAVEN_HOME/bin #ANT_HOME export ANT_HOME=/usr/local/apache-ant-1.10.7 export PATH=$PATH:$ANT_HOME/bin ```
-
source /etc/profile (使配置生效)
-
配置maven源下载(vi /usr/local/apache-maven-3.6.3/conf/settings.xml)
<mirrors> <!-- mirror | Specifies a repository mirror site to use instead of a given repository. The repository that | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used | for inheritance and direct lookup purposes, and must be unique across the set of mirrors. | <mirror> <id>alimaven</id> <mirrorOf>central</mirrorOf> <name>aliyun maven</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> </mirror> <mirror> <id>mirrorId</id> <mirrorOf>repositoryId</mirrorOf> <name>Human Readable Name for this Mirror.</name> <url>http://my.repository.com/repo/path</url> </mirror> --> </mirrors>
-
配置protobuf
yum -y install gcc c++ yum -y install gcc-c++ yum -y install make tar -zxvf protobuf-2.5.0.tar.gz mv protobuf-2.5.0/ /usr/local/ cd /usr/local/protobuf-2.5.0/ ./configure #配置环境变量(vi /etc/profile) #protobuf export LD_LIBRARY_PATH=/usr/local/protobuf-2.5.0 export PATH=$PATH:$LD_LIBRARY_PATH ##配置生效 source /etc/profile
-
各种依赖命令
yum -y install svn ncurses-devel gcc* yum -y install lzo-devel zlib-devel autoconf automake libtool cmake openssl-devel
-
编译hadoop
tar -zxvf hadoop-3.3.1-src.tar.gz mv hadoop-3.3.1-src /usr/local/ cd /usr/local/hadoop-3.3.1-src/ mvn package -Pdist -DskipTests -Dtar -Dmaven.javadoc.skip=true (约30分钟左右耐心等待)
- 成功后在 hadoop-dist/target/ 下找生成的包
这篇关于hadoop 自编译(Linux)的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-11-12如何创建可引导的 ESXi USB 安装介质 (macOS, Linux, Windows)
- 2024-11-08linux的 vi编辑器中搜索关键字有哪些常用的命令和技巧?-icode9专业技术文章分享
- 2024-11-08在 Linux 的 vi 或 vim 编辑器中什么命令可以直接跳到文件的结尾?-icode9专业技术文章分享
- 2024-10-22原生鸿蒙操作系统HarmonyOS NEXT(HarmonyOS 5)正式发布
- 2024-10-18操作系统入门教程:新手必看的基本操作指南
- 2024-10-18初学者必看:操作系统入门全攻略
- 2024-10-17操作系统入门教程:轻松掌握操作系统基础知识
- 2024-09-11Linux部署Scrapy学习:入门级指南
- 2024-09-11Linux部署Scrapy:入门级指南
- 2024-08-21【Linux】分区向左扩容的方法