来一发CentOS 6.5编译装置hadoop-2.2.0
如果您觉得本篇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中增加的设置:
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是不是装置乐成,呈现以下信息暗示装置乐成。
viewplaincopy
[*]#java-version
[*]javaversion"1.7.0_71"
[*]OpenJDKRuntimeEnvironment(rhel-2.5.3.1.el6-x86_64u71-b14)
[*]OpenJDK64-BitServerVM(build24.65-b04,mixedmode)
[*]#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。
统统筹办停当,入手下手编译:
viewplaincopy
[*]cd/home/***/softwares/hadoop/hadoop-2.2.0-src
[*]mvnpackage-Pdist,native-DskipTests-Dtar
必要守候一段工夫,编译乐成以后的了局以下(maven利用默许镜像):
viewplaincopy
[*]ReactorSummary:
[*]
[*]ApacheHadoopMain................................SUCCESS
[*]ApacheHadoopProjectPOM.........................SUCCESS
[*]ApacheHadoopAnnotations.........................SUCCESS
[*]ApacheHadoopAssemblies..........................SUCCESS
[*]ApacheHadoopProjectDistPOM....................SUCCESS
[*]ApacheHadoopMavenPlugins.......................SUCCESS
[*]ApacheHadoopAuth................................SUCCESS
[*]ApacheHadoopAuthExamples.......................SUCCESS
[*]ApacheHadoopCommon..............................SUCCESS
[*]ApacheHadoopNFS.................................SUCCESS
[*]ApacheHadoopCommonProject......................SUCCESS
[*]ApacheHadoopHDFS................................SUCCESS
[*]ApacheHadoopHttpFS..............................SUCCESS
[*]ApacheHadoopHDFSBookKeeperJournal.............SUCCESS
[*]ApacheHadoopHDFS-NFS............................SUCCESS
[*]ApacheHadoopHDFSProject........................SUCCESS
[*]hadoop-yarn.......................................SUCCESS
[*]hadoop-yarn-api...................................SUCCESS
[*]hadoop-yarn-common................................SUCCESS
[*]hadoop-yarn-server................................SUCCESS
[*]hadoop-yarn-server-common.........................SUCCESS
[*]hadoop-yarn-server-nodemanager....................SUCCESS
[*]hadoop-yarn-server-web-proxy......................SUCCESS
[*]hadoop-yarn-server-resourcemanager................SUCCESS
[*]hadoop-yarn-server-tests..........................SUCCESS
[*]hadoop-yarn-client................................SUCCESS
[*]hadoop-yarn-applications..........................SUCCESS
[*]hadoop-yarn-applications-distributedshell.........SUCCESS
[*]hadoop-mapreduce-client...........................SUCCESS
[*]hadoop-mapreduce-client-core......................SUCCESS
[*]hadoop-yarn-applications-unmanaged-am-launcher....SUCCESS
[*]hadoop-yarn-site..................................SUCCESS
[*]hadoop-yarn-project...............................SUCCESS
[*]hadoop-mapreduce-client-common....................SUCCESS
[*]hadoop-mapreduce-client-shuffle...................SUCCESS
[*]hadoop-mapreduce-client-app.......................SUCCESS
[*]hadoop-mapreduce-client-hs........................SUCCESS
[*]hadoop-mapreduce-client-jobclient.................SUCCESS
[*]hadoop-mapreduce-client-hs-plugins................SUCCESS
[*]ApacheHadoopMapReduceExamples..................SUCCESS
[*]hadoop-mapreduce..................................SUCCESS
[*]ApacheHadoopMapReduceStreaming.................SUCCESS
[*]ApacheHadoopDistributedCopy....................SUCCESS
[*]ApacheHadoopArchives............................SUCCESS
[*]ApacheHadoopRumen...............................SUCCESS
[*]ApacheHadoopGridmix.............................SUCCESS
[*]ApacheHadoopDataJoin...........................SUCCESS
[*]ApacheHadoopExtras..............................SUCCESS
[*]ApacheHadoopPipes...............................SUCCESS
[*]ApacheHadoopToolsDist..........................SUCCESS
[*]ApacheHadoopTools...............................SUCCESS
[*]ApacheHadoopDistribution........................SUCCESS
[*]ApacheHadoopClient..............................SUCCESS
[*]ApacheHadoopMini-Cluster........................SUCCESS
[*]------------------------------------------------------------------------
[*]BUILDSUCCESS
[*]------------------------------------------------------------------------
[*]Totaltime:10:40.193s
[*]Finishedat:FriNov2114:43:06CST2014
[*]FinalMemory:131M/471M
[*]------------------------------------------------------------------------
编译后的文件为hadoop-2.2.0-src/hadoop-dist/target/hadoop-2.2.0。
2.单节点装置hadoop
以下接纳single-node形式在CentOS6.564bits中装置hadoop-2.2.0。
2.1创立用户组及增加用户
来一发CentOS 6.5编译装置hadoop-2.2.0
我十目一行也还是看不懂啊。 查阅经典工具书和Howto,特别是Howto是全球数以万计的Linux、Unix的经验总结非常有参考价值通常40%的问题同样可以解决。 直到学习Linux这门课以后,我才知道,原来我错了。? 选择一些适于初学者的Linux社区。 放手去搞。尽量不要提问,运用搜索找答案,或者看wiki,从原理上理解操作系统的本质,而不是满足于使用几个技巧。尽量看英文资料。 放手去搞。尽量不要提问,运用搜索找答案,或者看wiki,从原理上理解操作系统的本质,而不是满足于使用几个技巧。尽量看英文资料。 学习Linux半年了~个人认为不会的多在网上找资料网上有很多资料可以搜索到,LS那位说放手去搞。 主流Linux发行版都自带非常详细的文档(包括手册页和FAQ),从系统安装到系统安全,针对不同层次的人的详尽文档,仔细阅读文档后40%问题都可在此解决。
页:
[1]