频道栏目
首页 > 网络 > 云计算 > 正文

hadoop-2.5.0源码编译

2016-09-19 09:31:43           
收藏   我要投稿

第一步:解压hadoop-2.5.0-src.tar.gz至/opt/modules/目录下

[qianxin@hadoop-master hadoop-2.5.0]$ tar -zxvf /opt/softwares/hadoop-2.5.0-src.tzr.gz -C /opt/modules

 

\


\

 <喎"http://www.2cto.com/kf/ware/vc/" target="_blank" class="keylink">vcD4NCjxwPjxzdHJvbmc+tdq2/rK9o7q94tG5amRrMS43LjBfNjc8L3N0cm9uZz48L3A+DQo8cHJlIGNsYXNzPQ=="brush:java;"> [qianxin@hadoop-master hadoop-2.5.0]$ tar -zxvf /opt/softwares/jdk-7u67-linux-x64.tar.gz -C /opt/modules

 

\

 

第三步:配置java环境变量

export JAVA_HOME=/opt/modules/jdk1.7.0_67
export JRE_HOME=$JAVA_HOME/jre
export PATH=$PATH:$JAVA_HOME/bin:JRE_HOME/bin

 

\

 

[root@hadoop-master hadoop-2.5.0]# source /etc/profile
[root@hadoop-master hadoop-2.5.0]# su - qianxin
[qianxin@hadoop-master hadoop-2.5.0]$ java -version
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

 

\

 

第四步:安装MAVEN、配置MAVEN环境变量

[qianxin@hadoop-master hadoop-2.5.0]$ tar -zxvf /opt/softwares/apache-maven-3.0.5-bin.tar.gz -C /opt/modules
[qianxin@hadoop-master hadoop-2.5.0]$ su - root
[root@hadoop-master hadoop-2.5.0]# vi /etc/profile
[root@hadoop-master hadoop-2.5.0]# source /etc/profile
[root@hadoop-master hadoop-2.5.0]# su - qianxin
[qianxin@hadoop-master hadoop-2.5.0]$ mvn -version
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 21:51:28+0800)
Maven home: /opt/modules/apache-maven-3.0.5
Java version: 1.7.0_67, vendor: Oracle Corporation
Java home: /opt/modules/jdk1.7.0_67/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-431.el6.x86_64", arch: "amd64", family: "unix"

 

\


\

 

第五步:安装gcc/gcc-c++/make

[qianxin@hadoop-master hadoop-2.5.0]$ su - root
[root@hadoop-master hadoop-2.5.0]# yum -y install gcc gcc-c++
[root@hadoop-master hadoop-2.5.0]# yum install make

 

\


\

 

第六步:解压安装protobuf

[qianxin@hadoop-master hadoop-2.5.0]$ tar -zxvf protobuf-2.5.0.tar.gz -C /opt/modules/
[qianxin@hadoop-master hadoop-2.5.0]$ cd /opt/modules/protobuf-2.5.0/
[qianxin@hadoop-master protobuf-2.5.0]$ ./configure --prefix=/usr/local/protoc
[qianxin@hadoop-master protobuf-2.5.0]$ make
[qianxin@hadoop-master protobuf-2.5.0]$ su - root
[root@hadoop-master ~]# cd /opt/modules/protobuf-2.5.0
[root@hadoop-master protobuf-2.5.0]# make install

 

\


\


\


\

 

第七步:配置protobuf环境变量

[qianxin@hadoop-master hadoop-2.5.0]$ sudo vim /etc/profile
[qianxin@hadoop-master hadoop-2.5.0]$ su - root
[root@hadoop-master ~]# source /etc/profile
[root@hadoop-master ~]# su - qianxin
[qianxin@hadoop-master hadoop-2.5.0]$ protoc --version
libprotoc 2.5.0

 

\


\

 

第八步:下载安装CMake、openssl、ncurses

[qianxin@hadoop-master ~]$ su - root
[root@hadoop-master ~]# yum install cmake
[root@hadoop-master ~]# yum install openssl-devel
[root@hadoop-master ~]# yum install ncurses-devel

 

\


\


\

 

第九步:添加配置镜像

路径:/opt/modules/apache-maven-3.0.5/conf/setting.xml

 

\

 

第十步:开始编译hadoop源码包

[qianxin@hadoop-master ~]$ cd /opt/modules/hadoop-2.5.0-src/
[qianxin@hadoop-master ~]$ mvn package -DskipTests -Pdist,native

 

\

 

等待10分钟左右,即可看到以下编译成功的信息:

\

 

用编译后/opt/modules/hadoop-2.5.0-src/hadoop-dist/target/hadoop-2.5.0/lib目录下新的native文件夹,替换/opt/modules/hadoop-2.5.0/lib目录下旧的native文件夹即可解决执行hdfs相关命令时报的警告:

\

上一篇:hadoop伪分布式环境搭建与测试
下一篇:hadoop基础--hadoop实战(四)---myeclipse开发MapReduce-myeclipse搭建hadoop开发环境并运行wordcount
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站