|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的好朋友们!这几天在揣摩Hadoop,起首是装置Hadoop,在装置过程当中呈现过很多成绩,如今将全部历程总结一下,收集上已有良多这方面的材料了,但我以为仍是有需要记叙一下局部主要装置历程,便利今后发明与办理成绩,也但愿能给必要的伴侣一些参考。
我所用体系是CentOS6.564bit,编译装置hadoop-2.2.0,hadoop设置为单节点。在ApacheHadoop下载的hadoop-2.2.0有两种版本:1)编译版本:hadoop-2.2.0.tar.gz,2)源代码版本:hadoop-2.2.0-src.tar.gz。关于编译版本,解紧缩落后行设置就能够利用了,而关于源代码版本,先要编译,然后再举行设置。
我第一次装hadoop-2.2.0利用的是编译版本,但因为我的体系是64位,自带的native-hadooplibrary不克不及利用(自带的库合用于32位体系,但不合用于64位体系),老是呈现以下提醒:”WARNutil.NativeCodeLoader:Unabletoloadnative-hadooplibraryforyourplatform...usingbuiltin-javaclasseswhereapplicable”(成绩综述3.2),因而我接纳源代码从头编译装置。
1编译hadoop-2.2.0源代码
1.1编译前情况筹办
我编译源代码过程当中参考的是这个篇博文:hadoop2.2.0centos编译装置详解,这个中必要装置的软件大概包有很多,能够分为两类:
- yum装置:java,gcc,gcc-c++,make,lzo-devel,zlib-devel,gcc,autoconf,automake,libtool,ncurses-devel,openssl-devel。
- 手动装置:Maven,ProtocolBuffer。
关于yum装置的软件大概依附包,在CentOS6.5中年夜局部大概都已事后装置了,能够先先反省一下是不是装置大概更新:yuminfopackage,假如必要装置:yum-yinstallpackage,假如有可用更新:yum-yupdatepackage。
关于手动装置中的软件,必要先下载软件包,然后再装置,利用的详细版本是protobuf-2.5.0.tar.gz(http://download.csdn.net/detail/erli11/7408809,官方网站被wall了能够选择这个下载),apache-maven-3.0.5-bin.zip(mirror.bit.edu.cn/apache/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.zip),protobuf必要接纳源码装置;maven是编译版本,只需设置情况变量。但请注重:不要利用Maven3.1.1,由于Maven3.1.1与Maven3.0.x存在兼容性成绩,不克不及乐成下载插件,会呈现成绩maven-"ServiceUnavailable"。倡议利用oschina的maven镜像,由于外洋的某些网站大概会被Wall。这两个软件的装置都可参考下面的博客。
装置完下面所列出的软件大概依附包后,必要设置体系情况变量,让体系可以找到软件所对应的下令,以下是我在/root/.bashrc中增加的设置:
[plain]viewplaincopy
- exportJAVA_HOME="/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.71.x86_64"
- exportCLASSPATH=.:${JAVA_HOME}/lib/:${JAVA_HOME}/jre/lib/
- exportPATH=${JAVA_HOME}/bin:${JAVA_HOME}/jre/bin:$PATH
- exportMAVEN_HOME="/usr/local/src/apache-maven-3.0.5"
- exportPATH=$PATH:$MAVEN_HOME/bin
- exportPROTOBUF_HOME="/usr/local/protobuf"
- exportPATH=$PATH:$PROTOBUF_HOME/bin
在/root/.bashrc设置情况变量后必要利用下令source/root/.bashrc加载设置。检测java和maven是不是装置乐成,呈现以下信息暗示装置乐成。
[plain]viewplaincopy
- [root@lls~]#java-version
- javaversion"1.7.0_71"
- OpenJDKRuntimeEnvironment(rhel-2.5.3.1.el6-x86_64u71-b14)
- OpenJDK64-BitServerVM(build24.65-b04,mixedmode)
- [root@lls~]#mvn-version
- ApacheMaven3.0.5(r01de14724cdef164cd33c7c8c2fe155faf9602da;2013-02-1921:51:28+0800)
- Mavenhome:/usr/local/src/apache-maven-3.0.5
- Javaversion:1.7.0_71,vendor:OracleCorporation
- Javahome:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.71.x86_64/jre
- Defaultlocale:en_US,platformencoding:UTF-8
- OSname:"linux",version:"2.6.32-431.29.2.el6.x86_64",arch:"amd64",family:"unix"
1.2编译hadoop
下载hadoop-2.2.0(http://apache.fastbull.org/hadoop/common/hadoop-2.2.0/hadoop-2.2.0-src.tar.gz,官方已不撑持下载,能够在这里下载)源代码,hadoop-2.2.0的SourceCode紧缩包解压出来的源代码有个bug必要patch后才干编译,参考:https://issues.apache.org/jira/browse/HADOOP-10110。
统统筹办停当,入手下手编译:
[plain]viewplaincopy
- cd/home/***/softwares/hadoop/hadoop-2.2.0-src
- mvnpackage-Pdist,native-DskipTests-Dtar
必要守候一段工夫,编译乐成以后的了局以下(maven利用默许镜像):
[plain]viewplaincopy
- [INFO]ReactorSummary:
- [INFO]
- [INFO]ApacheHadoopMain................................SUCCESS[2.109s]
- [INFO]ApacheHadoopProjectPOM.........................SUCCESS[1.828s]
- [INFO]ApacheHadoopAnnotations.........................SUCCESS[5.266s]
- [INFO]ApacheHadoopAssemblies..........................SUCCESS[0.228s]
- [INFO]ApacheHadoopProjectDistPOM....................SUCCESS[2.184s]
- [INFO]ApacheHadoopMavenPlugins.......................SUCCESS[3.562s]
- [INFO]ApacheHadoopAuth................................SUCCESS[3.128s]
- [INFO]ApacheHadoopAuthExamples.......................SUCCESS[2.444s]
- [INFO]ApacheHadoopCommon..............................SUCCESS[1:17.748s]
- [INFO]ApacheHadoopNFS.................................SUCCESS[16.455s]
- [INFO]ApacheHadoopCommonProject......................SUCCESS[0.056s]
- [INFO]ApacheHadoopHDFS................................SUCCESS[2:18.736s]
- [INFO]ApacheHadoopHttpFS..............................SUCCESS[18.687s]
- [INFO]ApacheHadoopHDFSBookKeeperJournal.............SUCCESS[23.553s]
- [INFO]ApacheHadoopHDFS-NFS............................SUCCESS[3.453s]
- [INFO]ApacheHadoopHDFSProject........................SUCCESS[0.046s]
- [INFO]hadoop-yarn.......................................SUCCESS[48.652s]
- [INFO]hadoop-yarn-api...................................SUCCESS[44.591s]
- [INFO]hadoop-yarn-common................................SUCCESS[30.677s]
- [INFO]hadoop-yarn-server................................SUCCESS[0.096s]
- [INFO]hadoop-yarn-server-common.........................SUCCESS[9.340s]
- [INFO]hadoop-yarn-server-nodemanager....................SUCCESS[16.656s]
- [INFO]hadoop-yarn-server-web-proxy......................SUCCESS[3.115s]
- [INFO]hadoop-yarn-server-resourcemanager................SUCCESS[13.133s]
- [INFO]hadoop-yarn-server-tests..........................SUCCESS[0.614s]
- [INFO]hadoop-yarn-client................................SUCCESS[4.646s]
- [INFO]hadoop-yarn-applications..........................SUCCESS[0.100s]
- [INFO]hadoop-yarn-applications-distributedshell.........SUCCESS[2.815s]
- [INFO]hadoop-mapreduce-client...........................SUCCESS[0.096s]
- [INFO]hadoop-mapreduce-client-core......................SUCCESS[23.624s]
- [INFO]hadoop-yarn-applications-unmanaged-am-launcher....SUCCESS[2.056s]
- [INFO]hadoop-yarn-site..................................SUCCESS[0.099s]
- [INFO]hadoop-yarn-project...............................SUCCESS[11.009s]
- [INFO]hadoop-mapreduce-client-common....................SUCCESS[20.053s]
- [INFO]hadoop-mapreduce-client-shuffle...................SUCCESS[3.310s]
- [INFO]hadoop-mapreduce-client-app.......................SUCCESS[9.819s]
- [INFO]hadoop-mapreduce-client-hs........................SUCCESS[4.843s]
- [INFO]hadoop-mapreduce-client-jobclient.................SUCCESS[6.115s]
- [INFO]hadoop-mapreduce-client-hs-plugins................SUCCESS[1.682s]
- [INFO]ApacheHadoopMapReduceExamples..................SUCCESS[6.336s]
- [INFO]hadoop-mapreduce..................................SUCCESS[3.946s]
- [INFO]ApacheHadoopMapReduceStreaming.................SUCCESS[4.788s]
- [INFO]ApacheHadoopDistributedCopy....................SUCCESS[8.510s]
- [INFO]ApacheHadoopArchives............................SUCCESS[2.061s]
- [INFO]ApacheHadoopRumen...............................SUCCESS[7.269s]
- [INFO]ApacheHadoopGridmix.............................SUCCESS[4.815s]
- [INFO]ApacheHadoopDataJoin...........................SUCCESS[3.659s]
- [INFO]ApacheHadoopExtras..............................SUCCESS[3.132s]
- [INFO]ApacheHadoopPipes...............................SUCCESS[9.350s]
- [INFO]ApacheHadoopToolsDist..........................SUCCESS[1.850s]
- [INFO]ApacheHadoopTools...............................SUCCESS[0.023s]
- [INFO]ApacheHadoopDistribution........................SUCCESS[19.184s]
- [INFO]ApacheHadoopClient..............................SUCCESS[6.730s]
- [INFO]ApacheHadoopMini-Cluster........................SUCCESS[0.192s]
- [INFO]------------------------------------------------------------------------
- [INFO]BUILDSUCCESS
- [INFO]------------------------------------------------------------------------
- [INFO]Totaltime:10:40.193s
- [INFO]Finishedat:FriNov2114:43:06CST2014
- [INFO]FinalMemory:131M/471M
- [INFO]------------------------------------------------------------------------
编译后的文件为hadoop-2.2.0-src/hadoop-dist/target/hadoop-2.2.0。
2.单节点装置hadoop
以下接纳single-node形式在CentOS6.564bits中装置hadoop-2.2.0。
2.1创立用户组及增加用户
|
|