How to test Debian Hadoop

Apr 12, 2025 pm 10:03 PM
apache red

How to test Debian Hadoop

This article guides you to install and test Apache Hadoop on your Debian system. The following steps will provide detailed description of the configuration process and verification methods.

Step 1: Install Java

Make sure that the system has Java 8 or higher installed. Install OpenJDK 8 using the following command:

 sudo apt update
sudo apt install openjdk-8-jdk
Copy after login

Verify installation:

 java -version
Copy after login

Step 2: Download and decompress Hadoop

Download the latest version of Hadoop from the official website of Apache Hadoop and unzip it to the specified directory (for example /usr/local/hadoop ):

 wget https://downloads.apache.org/hadoop/common/hadoop-3.3.1/hadoop-3.3.1.tar.gz
tar -xzvf hadoop-3.3.1.tar.gz -C /usr/local/hadoop
``` (Please replace `hadoop-3.3.1` with the actual version number)


**Step 3: Configure environment variables**

Edit the `~/.bashrc` file and add the following environment variables:

```bash
export HADOOP_HOME=/usr/local/hadoop
export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin
Copy after login

Make the changes take effect:

 source ~/.bashrc
Copy after login

Step 4: Configure Hadoop configuration file

Modify the configuration file in the Hadoop directory:

  • core-site.xml :
<configuration>
  <property>
    <name>fs.defaultFS</name>
    <value>hdfs://namenode:9000</value>
  </property>
</configuration>
Copy after login
  • hdfs-site.xml :
<configuration>
  <property>
    <name>dfs.replication</name>
    <value>3</value>
  </property>
  <property>
    <name>dfs.namenode.name.dir</name>
    <value>/usr/local/hadoop/dfs/name</value>
  </property>
  <property>
    <name>dfs.datanode.data.dir</name>
    <value>/usr/local/hadoop/dfs/data</value>
  </property>
</configuration>
Copy after login
  • mapred-site.xml :
<configuration>
  <property>
    <name>mapreduce.framework.name</name>
    <value>yarn</value>
  </property>
</configuration>
Copy after login
  • yarn-site.xml :
<configuration>
  <property>
    <name>yarn.nodemanager.aux-services</name>
    <value>mapreduce_shuffle</value>
  </property>
  <property>
    <name>yarn.nodemanager.aux-services.mapreduce.shuffle.class</name>
    <value>org.apache.hadoop.mapred.ShuffleHandler</value>
  </property>
</configuration>
Copy after login

Step 5: Format HDFS

On the NameNode node, execute the following command to format HDFS:

 hdfs namenode -format
Copy after login

Step 6: Start Hadoop Service

Start NameNode and DataNode on the NameNode node:

 start-dfs.sh
Copy after login

Start YARN on the ResourceManager node:

 start-yarn.sh
Copy after login

Step 7: Local Mode Testing

Switch to Hadoop user:

 su - hadoop
Copy after login

Create input directories and files:

 mkdir ~/input
vi ~/input/data.txt
Copy after login

Enter test data (for example "Hello World", "Hello Hadoop"), save and exit.

Run WordCount example:

 hadoop jar /usr/local/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-examples-*.jar wordcount ~/input/data.txt ~/output
``` (Please adjust it according to the actual jar package file name)

View the results:

```bash
ls ~/output
cat ~/output/part-r-00000
Copy after login

The correct output indicates that Hadoop local mode is running successfully. Please note that the above steps assume that you are testing in a stand-alone environment. For cluster environments, corresponding configuration modifications are required. Be sure to refer to the official Hadoop documentation for more detailed and latest configuration information.

The above is the detailed content of How to test Debian Hadoop. 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)
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
1 months 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 check Debian OpenSSL configuration How to check Debian OpenSSL configuration Apr 12, 2025 pm 11:57 PM

This article introduces several methods to check the OpenSSL configuration of the Debian system to help you quickly grasp the security status of the system. 1. Confirm the OpenSSL version First, verify whether OpenSSL has been installed and version information. Enter the following command in the terminal: If opensslversion is not installed, the system will prompt an error. 2. View the configuration file. The main configuration file of OpenSSL is usually located in /etc/ssl/openssl.cnf. You can use a text editor (such as nano) to view: sudonano/etc/ssl/openssl.cnf This file contains important configuration information such as key, certificate path, and encryption algorithm. 3. Utilize OPE

How to set the cgi directory in apache How to set the cgi directory in apache Apr 13, 2025 pm 01:18 PM

To set up a CGI directory in Apache, you need to perform the following steps: Create a CGI directory such as "cgi-bin", and grant Apache write permissions. Add the "ScriptAlias" directive block in the Apache configuration file to map the CGI directory to the "/cgi-bin" URL. Restart Apache.

How to start apache How to start apache Apr 13, 2025 pm 01:06 PM

The steps to start Apache are as follows: Install Apache (command: sudo apt-get install apache2 or download it from the official website) Start Apache (Linux: sudo systemctl start apache2; Windows: Right-click the "Apache2.4" service and select "Start") Check whether it has been started (Linux: sudo systemctl status apache2; Windows: Check the status of the "Apache2.4" service in the service manager) Enable boot automatically (optional, Linux: sudo systemctl

How to view your apache version How to view your apache version Apr 13, 2025 pm 01:15 PM

There are 3 ways to view the version on the Apache server: via the command line (apachectl -v or apache2ctl -v), check the server status page (http://&lt;server IP or domain name&gt;/server-status), or view the Apache configuration file (ServerVersion: Apache/&lt;version number&gt;).

What to do if the apache80 port is occupied What to do if the apache80 port is occupied Apr 13, 2025 pm 01:24 PM

When the Apache 80 port is occupied, the solution is as follows: find out the process that occupies the port and close it. Check the firewall settings to make sure Apache is not blocked. If the above method does not work, please reconfigure Apache to use a different port. Restart the Apache service.

How to delete more than server names of apache How to delete more than server names of apache Apr 13, 2025 pm 01:09 PM

To delete an extra ServerName directive from Apache, you can take the following steps: Identify and delete the extra ServerName directive. Restart Apache to make the changes take effect. Check the configuration file to verify changes. Test the server to make sure the problem is resolved.

What are the security settings for Debian Tomcat logs? What are the security settings for Debian Tomcat logs? Apr 12, 2025 pm 11:48 PM

To improve the security of DebianTomcat logs, we need to pay attention to the following key policies: 1. Permission control and file management: Log file permissions: The default log file permissions (640) restricts access. It is recommended to modify the UMASK value in the catalina.sh script (for example, changing from 0027 to 0022), or directly set filePermissions in the log4j2 configuration file to ensure appropriate read and write permissions. Log file location: Tomcat logs are usually located in /opt/tomcat/logs (or similar path), and the permission settings of this directory need to be checked regularly. 2. Log rotation and format: Log rotation: Configure server.xml

How to set the Debian Apache log level How to set the Debian Apache log level Apr 13, 2025 am 08:33 AM

This article describes how to adjust the logging level of the ApacheWeb server in the Debian system. By modifying the configuration file, you can control the verbose level of log information recorded by Apache. Method 1: Modify the main configuration file to locate the configuration file: The configuration file of Apache2.x is usually located in the /etc/apache2/ directory. The file name may be apache2.conf or httpd.conf, depending on your installation method. Edit configuration file: Open configuration file with root permissions using a text editor (such as nano): sudonano/etc/apache2/apache2.conf

See all articles