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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

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)

How to run the h5 project How to run the h5 project Apr 06, 2025 pm 12:21 PM

Running the H5 project requires the following steps: installing necessary tools such as web server, Node.js, development tools, etc. Build a development environment, create project folders, initialize projects, and write code. Start the development server and run the command using the command line. Preview the project in your browser and enter the development server URL. Publish projects, optimize code, deploy projects, and set up web server configuration.

The difference in console.log output result: Why are the two calls different? The difference in console.log output result: Why are the two calls different? Apr 04, 2025 pm 05:12 PM

In-depth discussion of the root causes of the difference in console.log output. This article will analyze the differences in the output results of console.log function in a piece of code and explain the reasons behind it. �...

How to implement adaptive layout of Y-axis position in web annotation? How to implement adaptive layout of Y-axis position in web annotation? Apr 04, 2025 pm 11:30 PM

The Y-axis position adaptive algorithm for web annotation function This article will explore how to implement annotation functions similar to Word documents, especially how to deal with the interval between annotations...

How to accurately realize the small label effect in the design draft on the mobile terminal? How to accurately realize the small label effect in the design draft on the mobile terminal? Apr 04, 2025 pm 11:36 PM

How to achieve the effect of small labels in the design draft on the mobile terminal? When designing mobile applications, it is common to find out how to accurately restore the small label effect in the design draft...

How to solve the problem of grandfather's background obstructing pseudo-elements when text gradient adds shadows? How to solve the problem of grandfather's background obstructing pseudo-elements when text gradient adds shadows? Apr 05, 2025 pm 05:36 PM

When adding shadows to text gradients, the solution to the grandfather background blocks pseudo-elements. When adding shadows to text gradients, pseudo-elements and absolute positioning are usually used to...

How to export pdf with xml How to export pdf with xml Apr 03, 2025 am 06:45 AM

There are two ways to export XML to PDF: using XSLT and using XML data binding libraries. XSLT: Create an XSLT stylesheet, specify the PDF format to convert XML data using the XSLT processor. XML Data binding library: Import XML Data binding library Create PDF Document object loading XML data export PDF files. Which method is better for PDF files depends on the requirements. XSLT provides flexibility, while the data binding library is simple to implement; for simple conversions, the data binding library is better, and for complex conversions, XSLT is more suitable.

The difference in output results of console.log: Why do the same variables have different printing methods but different results? The difference in output results of console.log: Why do the same variables have different printing methods but different results? Apr 04, 2025 am 11:48 AM

In-depth discussion of the differences in console.log output in this article will analyze the reasons why the output results of console.log function in a piece of code are different. Code snippets involve URL parameter resolution...

In Go programming, how to correctly manage the connection and release resources between Mysql and Redis? In Go programming, how to correctly manage the connection and release resources between Mysql and Redis? Apr 02, 2025 pm 05:03 PM

Resource management in Go programming: Mysql and Redis connect and release in learning how to correctly manage resources, especially with databases and caches...

See all articles