通过源码的方式编译hadoop的安装文件
Hadoop2.4.0??重新編譯?64??位本地庫
原創作者:大鵬鳥?時間:2014-07-28
環境:虛擬機?VirtualBox,操作系統?64?位?CentOS?6.4
下載重新編譯需要的軟件包
apache-ant-1.9.4-bin.tar.gz
findbugs-3.0.0.tar.gz
protobuf-2.5.0.tar.gz
apache-maven-3.0.5-bin.tar.gz
下載?hadoop2.4.0?的源碼包
hadoop-2.4.0-src.tar.gz
壓解源碼包
[grid@hadoopMaster01?~]$?tar?-zxvf?hadoop-2.4.0-src.tar.gz
安裝編譯所需軟件
安裝?MAVEN
壓解?apache-maven-3.0.5-bin.tar.gz?到/opt/目錄
[root@hadoopMaster01?grid]#?tar?-zxvf?apache-maven-3.0.5-bin.tar.gz?-C?/opt/
修改/etc/profile?配置,增加?MAVEN?環境配置M2_HOME?? PATH
保存后使用?source?/etc/profile?使修改配置即時生效
[root@hadoopMaster01?apache-maven-3.0.5]#?source?/etc/profile
使用?mvn?-v?命令進行驗證,如圖所示表示安裝配置成功
安裝?ANT
壓解?apache-ant-1.9.4-bin.tar.gz?到/opt/目錄
[root@hadoopMaster01?grid]#?tar?-zxvf?apache-ant-1.9.4-bin.tar.gz?-C?/opt/
修改/etc/profile?配置,增加?ANT?環境配置 ANT_HOME?? PATH
保存后使用?source?/etc/profile?使修改配置即時生效
[root@hadoopMaster01?apache-ant-1.9.4]#?source?/etc/profile
使用?ant-version?命令進行驗證,如圖所示表示安裝配置成功
安裝?FINDBUGS
壓解?findbugs-3.0.0.tar.gz?到/opt/目錄
[root@hadoopMaster01?grid]#?tar?-zxvf?findbugs-3.0.0.tar.gz?-C?/opt/
修改/etc/profile?配置,增加?FINDBUGS?環境配置
保存后使用?source?/etc/profile?使修改配置即時生效
[root@hadoopMaster01?apache-ant-1.9.4]#?source?/etc/profile
使用?findbugs-version?命令進行驗證,如圖所示表示安裝配置成功
安裝?PROTOBUF
編譯?Hadoop?2.4.0,需要?protobuf?的編譯器protoc,一定要是?protobuf?2.5.0?以上
直接壓解?protobuf-2.5.0.tar.gz
[root@hadoopMaster01?grid]#?tar?-zxvf?protobuf-2.5.0.tar.gz
安裝?protobuf,依次執行如下命令
[root@hadoopMaster01?grid]#?cd protobuf-2.5.0
[root@hadoopMaster01?protobuf-2.5.0]#?ls
aclocal.m4?config.guess?configure?COPYING.txt?examples
install-sh?ltmain.sh?Makefile.in?protobuf.pc.in?src
autogen.sh?config.h.in?configure.ac?depcomp?generate_descriptor_proto.sh
INSTALL.txt?m4?missing?python?vsprojects
CHANGES.txt?config.sub?CONTRIBUTORS.txt?editors?gtest
java?Makefile.am?protobuf-lite.pc.in?README.txt
[root@hadoopMaster01?protobuf-2.5.0]#?./configure
[root@hadoopMaster01?protobuf-2.5.0]#?make
[root@hadoopMaster01?protobuf-2.5.0]#?make?check
[root@hadoopMaster01?protobuf-2.5.0]#?make?install
使用?protoc?--version?命令進行驗證,如圖所示表示安裝配置成功
安裝?依賴包
安裝?cmake,openssl-devel,ncurses-devel??依賴包(root??用戶且能夠連上互聯網)
[root@hadoopMaster01?~]#?yum?install?cmake
如下圖表示安裝成功
[root@hadoopMaster01?~]#?yum?install?openssl-devel
如下圖表示安裝成功
[root@hadoopMaster01?~]#?yum?install?ncurses-devel
如下圖表示依賴包系統中已經安裝并且為最新版本
編譯?64??位本地庫
進入已壓解的?hadoop?源碼目錄
[grid@hadoopMaster01?~]$?cd?hadoop-2.4.0-src
[grid@hadoopMaster01?hadoop-2.4.0-src]$?pwd
/home/grid/hadoop-2.4.0-src
執行?mvn?cleaninstall -DskipTests?命令,等待完成(會自動聯網下載很多東西)
[grid@hadoopMaster01?hadoop-2.4.0-src]$?mvn clean?install?-DskipTests
執行?mvn?package?-Pdist,native?-DskipTests?-Dtar?命令,開始編譯,等待完成
grid@hadoopMaster01?hadoop-2.4.0-src]$?mvn?package?-Pdist,native?-DskipTests?-Dtar
出現如下信息
[INFO]?------------------------------------------------------------------------
[INFO]?Reactor?Summary:
[INFO]
[INFO]?Apache?Hadoop?Main?................................?SUCCESS[6.304s]
[INFO]?Apache?Hadoop?Project?POM?.........................?SUCCESS?[26.555s]
[INFO]?Apache?Hadoop?Annotations?.........................?SUCCESS[2.757s]
[INFO]?Apache?Hadoop?Assemblies?..........................?SUCCESS?[0.216s]
[INFO]?Apache?Hadoop?Project?Dist?POM?....................?SUCCESS?[19.592s]
[INFO]?Apache?Hadoop?Maven?Plugins?.......................?SUCCESS?[2.715s]
[INFO]?Apache?Hadoop?MiniKDC?.............................?SUCCESS?[2.360s]
[INFO]?Apache?Hadoop?Auth?................................?SUCCESS?[2.950s]
[INFO]?Apache?Hadoop?Auth?Examples?.......................?SUCCESS[2.119s]
[INFO]?Apache?Hadoop?Common?..............................?SUCCESS?[1:22.302s]
[INFO]?Apache?Hadoop?NFS?.................................?SUCCESS?[5.095s]
[INFO]?Apache?Hadoop?Common?Project......................?SUCCESS?[0.026s]
[INFO]?Apache?Hadoop?HDFS?................................?SUCCESS?[2:06.178s]
[INFO]?Apache?Hadoop?HttpFS?..............................?SUCCESS?[1:09.142s]
[INFO]?Apache?Hadoop?HDFS?BookKeeper?Journal?.............?SUCCESS?[14.457s]
[INFO]?Apache?Hadoop?HDFS-NFS?............................SUCCESS?[2.859s]
[INFO]?Apache?Hadoop?HDFS?Project?........................?SUCCESS?[0.030s]
[INFO]?hadoop-yarn?.......................................?SUCCESS?[0.029s]
[INFO]?hadoop-yarn-api?...................................?SUCCESS?[59.010s]
[INFO]?hadoop-yarn-common?................................?SUCCESS?[20.743s]
[INFO]?hadoop-yarn-server?................................?SUCCESS[0.026s]
[INFO]?hadoop-yarn-server-common?.........................?SUCCESS?[7.344s]
[INFO]?hadoop-yarn-server-nodemanager?....................?SUCCESS?[11.726s]
[INFO]?hadoop-yarn-server-web-proxy?......................?SUCCESS?[2.508s]
[INFO]?hadoop-yarn-server-applicationhistoryservice?......?SUCCESS?[4.041s]
[INFO]?hadoop-yarn-server-resourcemanager?................?SUCCESS?[10.370s]
[INFO]?hadoop-yarn-server-tests?..........................?SUCCESS?[0.374s]
[INFO]?hadoop-yarn-client?................................?SUCCESS?[4.791s]
[INFO]?hadoop-yarn-applications?..........................?SUCCESS?[0.025s]
[INFO]?hadoop-yarn-applications-distributedshell?.........?SUCCESS?[2.242s]
[INFO]?hadoop-yarn-applications-unmanaged-am-launcher?....?SUCCESS?[1.553s]
[INFO]?hadoop-yarn-site?..................................?SUCCESS?[0.024s]
[INFO]?hadoop-yarn-project?...............................?SUCCESS?[3.261s]
[INFO]?hadoop-mapreduce-client?...........................?SUCCESS?[0.082s]
[INFO]?hadoop-mapreduce-client-core?......................?SUCCESS?[18.549s]
[INFO]?hadoop-mapreduce-client-common?....................?SUCCESS?[13.772s]
[INFO]?hadoop-mapreduce-client-shuffle?...................?SUCCESS?[2.441s]
[INFO]?hadoop-mapreduce-client-app?.......................?SUCCESS?[6.866s]
[INFO]?hadoop-mapreduce-client-hs?........................?SUCCESS?[6.280s]
[INFO]?hadoop-mapreduce-client-jobclient?.................SUCCESS?[3.510s]
[INFO]?hadoop-mapreduce-client-hs-plugins?................?SUCCESS?[1.725s]
[INFO]?Apache?Hadoop?MapReduce?Examples?..................?SUCCESS?[4.641s]
[INFO]?hadoop-mapreduce?..................................?SUCCESS[3.002s]
[INFO]?Apache?Hadoop?MapReduce?Streaming?.................?SUCCESS?[3.497s]
[INFO]?Apache?Hadoop?Distributed?Copy?....................?SUCCESS?[5.847s]
[INFO]?Apache?Hadoop?Archives?............................?SUCCESS?[1.791s]
[INFO]?Apache?Hadoop?Rumen?...............................?SUCCESS?[4.693s]
[INFO]?Apache?Hadoop?Gridmix?.............................?SUCCESS?[3.235s]
[INFO]?Apache?Hadoop?Data?Join...........................?SUCCESS?[2.349s]
[INFO]?Apache?Hadoop?Extras?..............................?SUCCESS?[2.488s]
[INFO]?Apache?Hadoop?Pipes?...............................?SUCCESS?[5.863s]
[INFO]?Apache?Hadoop?OpenStack?support?...................?SUCCESS?[3.776s]
[INFO]?Apache?Hadoop?Client?..............................?SUCCESS?[5.235s]
[INFO]?Apache?Hadoop?Mini-Cluster?........................?SUCCESS?[0.070s]
[INFO]?Apache?Hadoop?Scheduler?Load?Simulator?............?SUCCESS?[3.935s]
[INFO]?Apache?Hadoop?Tools?Dist?..........................?SUCCESS?[4.392s]
[INFO]?Apache?Hadoop?Tools?...............................?SUCCESS?[0.022s]
[INFO]?Apache?Hadoop?Distribution?........................?SUCCESS?[21.274s]
[INFO]?------------------------------------------------------------------------
[INFO]?BUILD?SUCCESS
[INFO]?------------------------------------------------------------------------
[INFO]?Total?time:?10:25.147s
[INFO]?Finished?at:?Mon?Jul?28?16:09:56?CST?2014
[INFO]?Final?Memory:?75M/241M
[INFO]?------------------------------------------------------------------------
表示編譯成功
進入/home/grid/hadoop-2.4.0-src/hadoop-dist/target/hadoop-2.4.0/lib/native?檢查,使用?file?*命
令,如下圖已經成功將編譯?64?本地庫
將?64?位的?native?文件夾替換原?32?位的文件夾即可
?
總結
以上是生活随笔為你收集整理的通过源码的方式编译hadoop的安装文件的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 分布式系统概述(来自学习资料)
- 下一篇: 东风悦达起亚多少钱 探究起亚车型价格及性