Home Operation and Maintenance Linux Operation and Maintenance How to build a Hadoop development environment on Debian

How to build a Hadoop development environment on Debian

Apr 12, 2025 pm 11:54 PM
apache red

How to build a Hadoop development environment on Debian

This guide details how to build a Hadoop development environment on a Debian system.

1. Install Java Development Kit (JDK)

First, install OpenJDK:

 sudo apt update
sudo apt install openjdk-11-jdk -y
Copy after login

Configure the JAVA_HOME environment variable:

 sudo nano /etc/environment
Copy after login

Add at the end of the file (adjust the path according to the actual JDK version):

 <code>JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64"</code>
Copy after login

Save and exit, and then execute:

 source /etc/environment
Copy after login

Verify installation:

 java -version
Copy after login

2. Install Hadoop

Download Hadoop 3.3.6 (or other version):

 wget https://www.apache.org/dyn/closer.cgi/hadoop/common/hadoop-3.3.6/hadoop-3.3.6-src.tar.gz
Copy after login

Verify download integrity:

 wget https://downloads.apache.org/hadoop/common/hadoop-3.3.6/hadoop-3.3.6-src.tar.gz.sha512
sha256sum -c hadoop-3.3.6-src.tar.gz.sha512
Copy after login

Create a directory and unzip:

 sudo mkdir /opt/hadoops
sudo tar -xzvf hadoop-3.3.6-src.tar.gz -C /opt/hadoops --strip-components 1
Copy after login

3. Configure Hadoop environment variables

Edit /etc/profile file and add:

 export HADOOP_HOME="/opt/hadoops/hadoop-3.3.6"
export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin
Copy after login

Refresh environment variables:

 source /etc/profile
Copy after login

4. Configure Hadoop core configuration file

Edit core-site.xml :

 sudo nano $HADOOP_HOME/etc/hadoop/core-site.xml
Copy after login

Add to:

<configuration>
  <property>
    <name>fs.defaultFS</name>
    <value>hdfs://localhost:9000</value>
  </property>
</configuration>
Copy after login

Edit hdfs-site.xml :

 sudo nano $HADOOP_HOME/etc/hadoop/hdfs-site.xml
Copy after login

Add to:

<configuration>
  <property>
    <name>dfs.replication</name>
    <value>1</value>
  </property>
  <property>
    <name>dfs.namenode.name.dir</name>
    <value>/opt/hadoops/hdfs/namenode</value>
  </property>
</configuration>
Copy after login

Edit mapred-site.xml :

 sudo nano $HADOOP_HOME/etc/hadoop/mapred-site.xml
Copy after login

Add to:

<configuration>
  <property>
    <name>mapreduce.framework.name</name>
    <value>yarn</value>
  </property>
</configuration>
Copy after login

Edit yarn-site.xml :

 sudo nano $HADOOP_HOME/etc/hadoop/yarn-site.xml
Copy after login

Add to:

<configuration>
  <property>
    <name>yarn.nodemanager.aux-services</name>
    <value>mapreduce_shuffle</value>
  </property>
</configuration>
Copy after login

5. Set SSH without password login

Generate SSH key:

 sudo su - hadoop
ssh-keygen -t rsa -P ""
Copy after login

Copy the public key:

 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
Copy after login

Test connection:

 ssh localhost
Copy after login

6. Format NameNode

 hdfs namenode -format
Copy after login

7. Start Hadoop service

 start-dfs.sh
start-yarn.sh
Copy after login

8. Verify Hadoop installation

Check cluster status:

 hdfs dfsadmin -report
Copy after login

Visit NameNode web interface: http://localhost:9870

After completing the above steps, the Hadoop development environment on your Debian system is completed. Please adjust the path and Hadoop version according to the actual situation.

The above is the detailed content of How to build a Hadoop development environment on Debian. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Using Dicr/Yii2-Google to integrate Google API in YII2 Using Dicr/Yii2-Google to integrate Google API in YII2 Apr 18, 2025 am 11:54 AM

VprocesserazrabotkiveB-enclosed, Мнепришлостольностьсясзадачейтерациигооглапидляпапакробоглесхетсigootrive. LEAVALLYSUMBALLANCEFRIABLANCEFAUMDOPTOMATIFICATION, ČtookazaLovnetakProsto, Kakaožidal.Posenesko

How to use the Redis cache solution to efficiently realize the requirements of product ranking list? How to use the Redis cache solution to efficiently realize the requirements of product ranking list? Apr 19, 2025 pm 11:36 PM

How does the Redis caching solution realize the requirements of product ranking list? During the development process, we often need to deal with the requirements of rankings, such as displaying a...

Title: How to use Composer to solve distributed locking problems Title: How to use Composer to solve distributed locking problems Apr 18, 2025 am 08:39 AM

Summary Description: Distributed locking is a key tool for ensuring data consistency when developing high concurrency applications. This article will start from a practical case and introduce in detail how to use Composer to install and use the dino-ma/distributed-lock library to solve the distributed lock problem and ensure the security and efficiency of the system.

What should I do if the Redis cache of OAuth2Authorization object fails in Spring Boot? What should I do if the Redis cache of OAuth2Authorization object fails in Spring Boot? Apr 19, 2025 pm 08:03 PM

In SpringBoot, use Redis to cache OAuth2Authorization object. In SpringBoot application, use SpringSecurityOAuth2AuthorizationServer...

Use Composer to simplify PHP project development: Practical application of pxniu/study library Use Composer to simplify PHP project development: Practical application of pxniu/study library Apr 18, 2025 am 11:06 AM

When developing PHP projects, we often encounter requirements such as frequent operation of databases, management of transactions, and dependency injection. If written manually, these operations are not only time-consuming and labor-intensive, but also prone to errors. Recently, I have encountered similar troubles in my projects, and handling these operations has become extremely complex and difficult to maintain. Fortunately, I found a Composer library called pxniu/study, which greatly simplified my development process. Composer can be learned through the following address: Learning address

Why is the return value empty when using RedisTemplate for batch query? Why is the return value empty when using RedisTemplate for batch query? Apr 19, 2025 pm 10:15 PM

Why is the return value empty when using RedisTemplate for batch query? When using RedisTemplate for batch query operations, you may encounter the returned results...

In a multi-node environment, how to ensure that Spring Boot's @Scheduled timing task is executed only on one node? In a multi-node environment, how to ensure that Spring Boot's @Scheduled timing task is executed only on one node? Apr 19, 2025 pm 10:57 PM

The optimization solution for SpringBoot timing tasks in a multi-node environment is developing Spring...

See all articles