大数据培训课程之Hadoop编译源码jar包安装

1 前期准备工作

  1. CentOS联网

配置CentOS能连接外网。Linux虚拟机ping www.baidu.com 是畅通的

注意:采用root角色编译,减少文件夹权限出现问题

  1. jar包准备(hadoop源码、JDK8、maven、ant 、protobuf)

(1)hadoop-2.7.2-src.tar.gz

(2)jdk-8u144-linux-x64.tar.gz

(3)apache-ant-1.9.9-bin.tar.gz(build工具,打包用的)

(4)apache-maven-3.0.5-bin.tar.gz

(5)protobuf-2.5.0.tar.gz(序列化的框架)

2 jar包安装

注意:所有操作必须在root用户下完成

  1. JDK解压、配置环境变量 JAVA_HOME和PATH,验证java-version(如下?#22841;?#35201;验证是否配置成功)

[[email protected] software] # tar -zxf jdk-8u144-linux-x64.tar.gz -C /opt/module/

 

[[email protected] software]# vi /etc/profile

#JAVA_HOME:

export JAVA_HOME=/opt/module/jdk1.8.0_144

export PATH=$PATH:$JAVA_HOME/bin

 

[[email protected] software]#source /etc/profile

验证命令:java -version

  1. Maven解压、配置 ?MAVEN_HOME和PATH

[[email protected] software]# tar -zxvf apache-maven-3.0.5-bin.tar.gz -C /opt/module/

 

[[email protected] apache-maven-3.0.5]# vi 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>mirrorId</id>

?????? <mirrorOf>repositoryId</mirrorOf>

?????? <name>Human Readable Name for this Mirror.</name>

?????? <url>http://my.repository.com/repo/path</url>

????? </mirror>

???? –>

??????? <mirror>

??????????????? <id>nexus-aliyun</id>

??????????????? <mirrorOf>central</mirrorOf>

??????????????? <name>Nexus aliyun</name>

??????????????? <url>http://maven.aliyun.com/nexus/content/groups/public</url>

??????? </mirror>

</mirrors>

 

[[email protected] apache-maven-3.0.5]# vi /etc/profile

#MAVEN_HOME

export MAVEN_HOME=/opt/module/apache-maven-3.0.5

export PATH=$PATH:$MAVEN_HOME/bin

 

[[email protected] software]#source /etc/profile

验证命令:mvn -version

  1. ant解压、配置 ?ANT _HOME和PATH

[[email protected] software]# tar -zxvf apache-ant-1.9.9-bin.tar.gz -C /opt/module/

 

[[email protected] apache-ant-1.9.9]# vi /etc/profile

#ANT_HOME

export ANT_HOME=/opt/module/apache-ant-1.9.9

export PATH=$PATH:$ANT_HOME/bin

 

[[email protected] software]#source /etc/profile

验证命令:ant -version

  1. 安装 glibc-headers 和 ?g++ ?命令如下

[[email protected] apache-ant-1.9.9]# yum install glibc-headers

[[email protected] apache-ant-1.9.9]#?yum install gcc-c++

  1. 安装make和cmake

[[email protected] apache-ant-1.9.9]# yum install make

[[email protected] apache-ant-1.9.9]# yum install cmake

  1. 解压protobuf ,进入到解压后protobuf主目录,/opt/module/protobuf-2.5.0,然后相继执行命令

[[email protected] software]# tar -zxvf protobuf-2.5.0.tar.gz -C /opt/module/

[[email protected] opt]# cd /opt/module/protobuf-2.5.0/

 

[[email protected] protobuf-2.5.0]#./configure?

[[email protected] protobuf-2.5.0]# make?

[[email protected] protobuf-2.5.0]# make check?

[[email protected] protobuf-2.5.0]# make install?

[[email protected] protobuf-2.5.0]# ldconfig?

 

[[email protected] hadoop-dist]# vi /etc/profile

#LD_LIBRARY_PATH

export LD_LIBRARY_PATH=/opt/module/protobuf-2.5.0

export PATH=$PATH:$LD_LIBRARY_PATH

 

[[email protected] software]#source /etc/profile

验证命令:protoc –version

  1. 安装openssl库

[[email protected] software]#yum install openssl-devel

  1. 安装ncurses-devel库

[[email protected] software]#yum install ncurses-devel

到此,编译工具安装基?#23601;?#25104;


上一篇:
下一篇:
关于我们
名师团队
新闻动态
合作企业
资源下载
视频下载
资料下载
工具下载
加入我们
招聘岗位
岗位介绍
招贤纳师
联系我们
电话:010-56253825
邮箱:[email protected]
地址:北京市昌?#35282;?#23439;福科技园综?#19979;?层(北京校区)

 深圳市宝安区西部硅谷大厦B座C区一层(深圳校区)

上海市松江区谷阳北路166号大江商厦6层(上海校区)

轩辕传奇通天塔
广东时时几点开盘 天津时时合法吗 大乐透全国名家预测总汇 bbin体育是哪个国家的 快三预测 永利34511app 新疆时时走势图大全 天线宝宝中特准特马资料3680 刮刮乐有中大奖被打 五分赛车开奖视频APP