共计 2106 个字符,预计需要花费 6 分钟才能阅读完成。
1. 不要使用最新的 Maven3.1.1,与 Maven3.0.x 存在兼容性问题,所以老是出现 java.lang.NoClassDefFoundError: org/sonatype/aether/graph/DependencyFilter 之类的错误。
我选择环境如下:
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 21:51:28+0800)
Maven home: /app/Hadoop/apache-maven-3.0.5
Java version: 1.7.0_45, vendor: Oracle Corporation
Java home: /app/hadoop/jdk1.7.0_45/jre
Default locale: en_US, platform encoding: UTF-8
OS name: “linux”, version: “2.6.32-358.23.2.el6.x86_64”, arch: “amd64”, family: “unix”
2. 最新的 2.2.0 的 Source Code 压缩包解压出来的 code 有个 bug 需要 patch 后才能编译。否则编译 hadoop-auth 会提示下面错误:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:testCompile (default-testCompile) on project hadoop-auth: Compilation failure: Compilation failure:
[ERROR] /home/chuan/trunk/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/client/AuthenticatorTestCase.java:[84,13] cannot access org.mortbay.component.AbstractLifeCycle
[ERROR] class file for org.mortbay.component.AbstractLifeCycle not found
Patch :https://issues.apache.org/jira/browse/HADOOP-10110
3. 安装下面安装包:
lzo-devel zlib-devel gcc autoconf automake libtool ncurses-devel openssl-devel
4. 安装下面程序
Ant Maven ProtocolBuffer findbugs CMake
5. /etc/profile 修改如下:
export JAVA_HOME=/app/hadoop/jdk1.7.0_45
export CLASSPATH=.:${JAVA_HOME}/lib/:${JAVA_HOME}/jre/lib/
export ANT_HOME=/app/hadoop/apache-ant-1.9.2
export MAVEN_HOME=/app/hadoop/apache-maven-3.0.5
export FINDBUGS_HOME=/app/hadoop/findbugs-2.0.3-rc1
export PATH=${JAVA_HOME}/bin:${JAVA_HOME}/jre/bin:${ANT_HOME}/bin:${MAVEN_HOME}/bin:${FINDBUGS_HOME}/bin:$PATH
5. build hadoop 包:
mvn package -DskipTests -Pdist,native,docs -Dtar
相关阅读 :
Ubuntu 13.04 上搭建 Hadoop 环境 http://www.linuxidc.com/Linux/2013-06/86106.htm
Ubuntu 12.10 +Hadoop 1.2.1 版本集群配置 http://www.linuxidc.com/Linux/2013-09/90600.htm
Ubuntu 上搭建 Hadoop 环境(单机模式 + 伪分布模式)http://www.linuxidc.com/Linux/2013-01/77681.htm
Ubuntu 下 Hadoop 环境的配置 http://www.linuxidc.com/Linux/2012-11/74539.htm
单机版搭建 Hadoop 环境图文教程详解 http://www.linuxidc.com/Linux/2012-02/53927.htm
搭建 Hadoop 环境(在 Winodws 环境下用虚拟机虚拟两个 Ubuntu 系统进行搭建)http://www.linuxidc.com/Linux/2011-12/48894.htm
更多 Hadoop 相关信息见 Hadoop 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=13