Get the App
SLTechnology News&Howtos  ›  Development  › 

How to build hadoop environment under linux

Shulou Source: shulou.com Published: 2022-05-31 21:48:51 09月21日 Update

This article mainly introduces the relevant knowledge of "how to build hadoop environment under linux". Xiaobian shows you the operation process through actual cases. The operation method is simple and fast, and the practicality is strong. I hope this article "how to build hadoop environment under linux" can help you solve the problem.

1. Download the hadoop package

wget http://apache.freelamp.com/hadoop/core/stable/hadoop-0.20.2.tar.gz

2、tar xvzf hadoop-0.20.2.tar.gz

3. Install jdk, download jdk directly from oracle website, address: www.oracle.com/technetwork/java/javase/downloads/index.html

4、chmod +x jdk-6u21-linux-i586.bin;./ jdk-6u21-linux-i586.bin, jdk1.6.0_21 directory appears in the current directory

5. Configure java environment variable vi /etc/profile

The copy code is as follows:

export java_home=/root/src/hadoop/jdk1.6.0_21

export classpath=$classpath:$java_home/lib:$java_home/jre/lib

export path=$path:$java_home/bin

Execute source /etc/profile under Terminal to validate configuration

6, can be viewed with the following command

Show java version java -vesion

The copy code is as follows:

echo $java_home

which java

echo $path

echo $classpath

If java-version doesn't show your version of jdk, check your path settings.

7. Configure the hadoop environment variable vi /etc/profile

The copy code is as follows:

export hadoop_install=/root/src/hadoop/hadoop-0.20.2

export path=$path:$hadoop_install/bin

source /etc/profile takes effect

8. Test environment

Hadoop version shows

hadoop 0.20.2

subversion https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20 -r 911707

compiled by chrisdo on fri feb 19 08:07:34 utc 2010

9. Configuration

Each component of hadoop is configured using an xml file, with core attributes in core-site.xml, hdfs attributes in hdfs-site.xml, and mapred-site.xml for mapred-reduce attributes. These files are in the conf subdirectory.

Hadoop has three modes: native mode, pseudo-distributed mode and fully distributed mode. The default configuration is native mode. There is no daemon process. Everything runs on a single jvm.

About "how to build hadoop environment under linux" content introduced here, thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the industry information channel. Xiaobian will update different knowledge points for you every day.

Tags: Configuration environment code pattern attributes knowledge variables files versions directories industries different practical content individual commands addresses subdirectories subdirectories utility Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker MariaDB OPPO Reno Shulou Technology Redmi