Compiling Hadoop 2.2.0 on 64-bit CentOS

Source: Internet
Author: User

1. Download the Hadoop 2.2.0 source package and unzip
$ wget http://mirrors.hust.edu.cn/apache/hadoop/common/hadoop-2.2.0/hadoop-2.2.0-src.tar.gz$ tar zxf hadoop-2.2.0-src.tar.gz
2. Install the following software
 $ sudo yum install cmake lzo-devel  zlib-devel  gcc autoconf automake libtool   ncurses-devel openssl-devel
3. Install Maven
$ wget http://mirror.esocc.com/apache/maven/maven-3/3.1.4/binaries/apache-maven-3.1.4-bin.tar.gz$ sudo tar zxf apache-maven-3.1.4-bin.tar.gz -C /opt$ sudo vim /etc/profileexport MAVEN_HOME=/opt/apache-maven-3.1.4export PATH=$PATH:$MAVEN_HOME/bin
Source/etc/profile
4. Install Ant
$ wget http://apache.dataguru.cn//ant/binaries/apache-ant-1.9.4-bin.tar.gz$ sudo tar zxf apache-ant-1.9.4-bin.tar.gz -C /opt$ sudo vim /etc/profileexport ANT_HOME=/opt/apache-ant-1.9.4export PATH=$PATH:$ANT_HOME/bin
5. Installing FindBugs
$ wget http://prdownloads.sourceforge.net/findbugs/findbugs-2.0.3.tar.gz?download$ sudo tar zxf findbugs-2.0.3.tar.gz -C /opt$ sudo vim /etc/profileexport FINDBUGS_HOME=/opt/findbugs-2.0.3export PATH=$PATH:$FINDBUGS_HOME/bin
6. Installing Protobuf
$ wget https://protobuf.googlecode.com/files/protobuf-2.5.0.tar.gz$ tar zxf protobuf-2.5.0.tar.gz$ cd protobuf-2.5.0$ ./configure$ make$ sudo make install
7. Make a patch to the Hadoop source

The latest Hadoop 2.2.0 source code compression package extracted code has a bug that requires a patch to compile. Otherwise, compiling Hadoop-auth will prompt the following error:

[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

Wget Https://issues.apache.org/jira/secure/attachment/12614482/HADOOP-10110.patch; Patch-p0 < Hadoop-10110.patch

8. Compiling Hadoop
cd hadoop-2.2.0-srcmvn package -DskipTests -Pdist,native -Dtar
9. Replace the 32-bit native library

with hadoop-2.2.0-src/hadoop-dist/target/hadoop-2.2.0/lib/native replace hadoop-2.2.0/lib/native .

rm -rf ~/local/opt/hadoop-2.2.0/lib/nativecp ./hadoop-dist/target/hadoop-2.2.0/lib/native ~/local/opt/hadoop-2.2.0/lib/

Hadoop Namenode-format

start-all.sh

JPs




Compiling Hadoop 2.2.0 on 64-bit CentOS

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.