Ubuntu14.0 installing Hadoop on the build

Source: Internet
Author: User
Tags linux mint

Ubuntu14.0on the build installationHadoop

Environment:

Hadoop-2.5.0.tar

Hadoop-2.5.0-src.tar

Jdk-7u71-linux-x64

Protobuf-2.5.0.tar

Maven3.0

Installation steps:

1 Installing the JDK, configuring environment variables

2 Installing dependent Packages

3 Installing MAVEN

4 Installing Protobuf-2.5.0.tar

5 Compiling Hadoop

6 Installing Hadoop

6.1 Stand-alone mode

6.2 Pseudo-Distribution mode

6.3 Cluster mode

1 installing the JDK, configuring environment variables

Download JDK version: jdk-7u71-linux-x64.gz The default download is placed in the download directory:

Enter the download directory;

    • 1 Unpacking the JDK installation package to the specified directory

sudo tar zxvf jdk-7u67-linux-x64.gz-c/usr/

By default, the JDK is placed in the. usr directory

    • Enter this directory to rename the JDK, this step to the JDK rename such as: jdk-1.7

sudo mv jdk-7u71-linux-x64.tar.gz jdk-1.7

    • Configuring Environment variables

Use vim ~/.bashrc command Editor (vi under Delete is x vim under delete backspace) may need to install Vim: sudo apt-get install vim

Add the following command at the bottom:

#set Java Environment

Export java_home=/usr/jdk-1.7

Export JRE_HOME=${JAVA_HOME}/JRE

Export Classpath=.:${java_home}/lib:${jre_home}/lib

Export Path=${java_home}/bin: $PATH

    • Use command: Source ~/.BASHRC

.

Modify the system default JDK.

sudo update-alternatives--install/usr/bin/java Java/usr/lib/jvm/jdk1.8.0_05/bin/java 300

sudo update-alternatives--install/usr/bin/javac Javac/usr/lib/jvm/jdk1.8.0_05/bin/javac 300

sudo update-alternatives--config java

sudo update-alternatives--config javac

Source:

    • Verify that the following fields appear in the terminal input Java to indicate successful installation

2 Installing dependent packages

2.1

sudo apt-get install g++ autoconf automake libtool make CMake zlib1g-dev pkg-config Libssl-dev

2.2 Because SSH is also used, so if not on the machine, it is OK to install a OpenSSH client (Ubuntu 12.04 should be preinstalled)

$ sudo apt-get install openssh-client

Install Server

$ sudo apt-get install openssh-server

3 Installing MAVEN

sudo apt-get install maven

Test:mvn--version

4 Installing Protobuf-2.5.0.tar

This has tried many ways on the Web:

Ar-xzf protobuf-2.1.0.tar.gz

CD protobuf-2.1.0

./configure--prefix=/usr/local/protobuf

Make

Make check

Make install

But the final installation failed, and eventually the installation was successful with the Apt-get command

Install Google Protocolbuffer

$ sudo apt-get install Protobuf-compiler

Verify that the version meets the requirements of the 2.5.0 version specified in the Installation guide BUILDING.txt after loading.

Uninstall $ sudo apt-get remove Protobuf-compiler

(The package under the ubuntu12.04 server is 2.4.1, a T classmate in Ubuntu 14.04 desktop through the apt-get installed is 2.5.0)

So under the ubuntu12.04 server still want to go to Google code to find source package compilation.

Source:

5 Compiling Hadoop

Finally (possibly multiple times into this "last"), CD into the source code root directory of Hadoop, view BUILDING.txt, if not accustomed to in the host browser into Hadoop's github to view the file directly from line 165th to line 167th, And look at the Maven life cycle and the like.

In the root directory of the Hadoop source code execution

(If for various reasons error back to this step, please first $ mvn clean)

$ mvn Package-pdist,native-dskiptests-dtar (here I omitted Src and doc)

11. Finally, if you see this information, even if the build is finished,--# tired.

[INFO]-------------------------

[INFO] BUILD SUCCESS

[INFO]-------------------------

[INFO] Total Time:xx:xx min

(My Linux Mint compiled 27min, the UBUNTU12 on the virtual machine compiled 42min, to find the rolling level beyond)

12. The results of the compilation are in the hadoop-dist/target/of the source root directory and executed in this directory.

$ hadoop-2.5.1/bin/hadoop Version

You can see the Hadoop version information and the compilation information.

The target directory is leafy, the CD cumbersome to understand the simple use of vim (Know HJKL and: Q), it is recommended to install the character interface of the Directory browser Ranger

$ sudo apt-get install Ranger

The way to use it is simple

$ ranger [Directory name] (default is the current directory if not hit)

Ubuntu14.0 installing Hadoop on the build

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.