Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to compile Hadoop-2.2.0

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article will explain in detail how to compile Hadoop-2.2.0 for you. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

The specific process is as follows:

Download the Hadoop2.2.0 source code package hadoop-2.2.0-src.tar.gz

Address: http://hadoop.apache.org/releases.html#Download

Install the appropriate dependency package

Yum-y install svn ncurses-devel gcc*

Yum-y install lzo-devel zlib-devel autoconf automake libtool cmake openssl-devel

These dependency packages are recommended to be installed when the linux system is connected to the Internet.

Install and configure the java environment

(1) download the java installation package from the official website

Http://www.oracle.com/technetwork/java/javase/downloads/index.html (choose the appropriate version, 64-bit version is used in this article)

(2) configure java environment variables

The profile file under / etc/ is usually modified under the root user, but this change will affect the entire system, so we take the second approach. Under the current user (this article is the hadoop user), ls-a, you will find that there is a .bash _ profile file, which is the profile of the current user, and its configuration will only take effect under the current user. So we add the jdk information at the end of this file, as follows:

Export JAVA_HOME=/home/hadoop/Java/jdk1.7.0_51

Export PATH=$JAVA_HOME/bin:$PATH

Export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

Save the exit and execute the source .bash _ profile command.

(3) check the java environment

Execute the java-version command to see the version in which java is installed.

Install maven tools

(1) download address: http://maven.apache.org/download.cgi

(2) after decompressing the downloaded toolkit, configure its environment variables

Add the following at the end of the .bahs _ profile file:

Export MAVEN_HOME=/home/hadoop/maven

Export PATH=$PATH:$MAVEN_HOME/bin

Install protobuf tools

(1) download address: http://code.google.com/p/protobuf/downloads/detail?name=protobuf-2.5.0.tar.gz

(2) the protobuf tool needs to be compiled as follows:

Decompress and set the owner to root chowd-R root.root protobuf-2.5.0

Compile and install protobuf

① cd protobuf-2.5.0

②. / configure

③ make

④ make install

(3) check the installation of protobuf

Protoc-version

Compile hadoop2.2.0

(1) perform official clean steps

Mvn clean install-DskipTests (maybe for a while)

Many success prompts will come out after the execution is successful!

(2) perform compilation

Next, perform the compilation of hadoop:

Mvn package-Pdist,native-DskipTests-Dtar

After waiting for a period of time, you will be prompted that the installation is complete, as shown in the figure:

Verify the compilation of hadoop

(1) check the compilation result

Go to the / hadoop-dist/target directory where the hadoop source code is located, and there will be a compiled hadoop2.2.0 as shown in the figure:

(2) verify the compiled hadoop

1 > go to the hadoop2.2.0 directory in the previous step, and you will see that the directory inside is the same as the official 32-bit system directory.

2 > go to the bin directory and execute the following command:

. / hadoop version (list the version information of hadoop)

3 > go to the hadoop-2.2.0 directory and execute the following command:

File lib//native/*

This is the end of the article on "how to compile Hadoop-2.2.0". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report