Operating System CentOS

How to Install Hadoop 3.5 in Stand-Alone Mode on AlmaLinux 9 or Rocky Linux 9

Install Apache Hadoop 3.5.0 with OpenJDK 17 in stand-alone mode on AlmaLinux 9 or Rocky Linux 9 and run the bundled MapReduce grep example.

This guide installs Apache Hadoop 3.5.0 in stand-alone (local) mode on AlmaLinux 9, Rocky Linux 9 or CentOS Stream 9 and runs one of the bundled MapReduce examples to prove that it works. Stand-alone mode is Hadoop's default: everything runs in a single Java process against the local file system, with no HDFS, no YARN and no daemons. It is the quickest way to learn the command-line tools and to debug MapReduce jobs before you move to a cluster.

CentOS 7 reached end of life in June 2024 and no longer receives updates. AlmaLinux 9 and Rocky Linux 9 are the binary-compatible replacements, and the commands below are the same on all three RHEL 9 family systems.

Requirements

  • A server running AlmaLinux 9, Rocky Linux 9 or CentOS Stream 9. Hadoop publishes binaries for x86_64 and for aarch64.
  • A user with sudo rights.
  • About 2 GB of free disk space: the binary archive is roughly 550 MB and unpacks to more than that.
  • Java 17. Hadoop 3.5.0, released on 2 April 2026, is the first stable release of the 3.5 line and requires Java 17 on the server side.

You do not need SSH keys or pdsh for stand-alone mode. Hadoop only uses them to start daemons on cluster nodes.

Step 1: Update the system and install Java 17

Update the installed packages, then install the headless OpenJDK 17 runtime together with the tools used later in this guide:

sudo dnf update -y
sudo dnf install -y java-17-openjdk-headless curl tar

Check that Java 17 is the active runtime:

java -version

The first line of the output should start with openjdk version "17. If another Java version is already installed and selected, switch the default with sudo alternatives --config java.

Step 2: Download and verify Hadoop

The Apache Hadoop releases page lists the current versions and their download links. Download the 3.5.0 binary archive and its SHA-512 checksum file:

cd /tmp
curl -fLO https://dlcdn.apache.org/hadoop/common/hadoop-3.5.0/hadoop-3.5.0.tar.gz
curl -fLO https://downloads.apache.org/hadoop/common/hadoop-3.5.0/hadoop-3.5.0.tar.gz.sha512

On an ARM server, download hadoop-3.5.0-aarch64.tar.gz and its .sha512 file instead, and adjust the file name in the commands that follow.

Verify the archive against the checksum:

sha512sum -c hadoop-3.5.0.tar.gz.sha512

The command must print hadoop-3.5.0.tar.gz: OK. If it reports a mismatch, delete the archive and download it again. For a stronger check, each release also has a .asc GPG signature that you can verify against the project's KEYS file.

Step 3: Install Hadoop under /opt

Unpack the archive into /opt, make root the owner, and create a version-independent symbolic link so that paths stay the same after an upgrade:

sudo tar -xzf hadoop-3.5.0.tar.gz -C /opt
sudo chown -R root:root /opt/hadoop-3.5.0
sudo ln -s /opt/hadoop-3.5.0 /opt/hadoop

Step 4: Tell Hadoop where Java is

Hadoop reads JAVA_HOME from etc/hadoop/hadoop-env.sh inside the installation directory. The OpenJDK package on RHEL 9 family systems provides a stable path that survives minor Java updates. Confirm that it exists:

ls -d /usr/lib/jvm/jre-17-openjdk

Append the setting to the Hadoop environment file:

echo 'export JAVA_HOME=/usr/lib/jvm/jre-17-openjdk' | sudo tee -a /opt/hadoop/etc/hadoop/hadoop-env.sh

If the ls command reports that the directory does not exist, find the real location with readlink -f "$(command -v java)" and use that path without the trailing /bin/java.

Step 5: Add Hadoop to your PATH

Create a profile script so that every login shell can find the hadoop command:

sudo tee /etc/profile.d/hadoop.sh > /dev/null <<'EOF'
export HADOOP_HOME=/opt/hadoop
export PATH=$PATH:$HADOOP_HOME/bin
EOF

Load it into your current session and check the installed version:

source /etc/profile.d/hadoop.sh
hadoop version

The first line of the output should read Hadoop 3.5.0.

Step 6: Run a test job

The distribution includes a jar with example MapReduce programs. The grep example reads every file in an input directory, counts the strings that match a regular expression and writes the result to an output directory. Use Hadoop's own configuration files as input:

mkdir ~/input
cp /opt/hadoop/etc/hadoop/*.xml ~/input

Run the job:

hadoop jar /opt/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-examples-3.5.0.jar grep ~/input ~/output 'dfs[a-z.]+'

Hadoop prints the job progress followed by a block of counters (file system counters, map-reduce framework counters and shuffle errors). When it finishes, display the result:

cat ~/output/*

You should see each matched string with the number of times it occurs, for example a line containing dfsadmin. The output directory also holds an empty _SUCCESS file, which marks a job that completed without errors.

Hadoop refuses to write into an output directory that already exists. Remove it before you run the job again:

rm -r ~/output

What stand-alone mode does and does not give you

In this mode the hadoop command starts one JVM, runs the job with the local job runner and exits. Paths such as ~/input are ordinary directories on the server's disk, and commands like hadoop fs -ls / list the local root file system rather than HDFS. Nothing listens on the network, so there are no firewall ports to open and no services to enable.

When you want HDFS and YARN on the same machine, the next step is pseudo-distributed mode, where each daemon runs as its own Java process. That requires edits to core-site.xml and hdfs-site.xml, passwordless SSH to localhost and a formatted NameNode; the official single-node setup guide walks through it.

Upgrading later

To move to a newer release, download and verify the new archive, unpack it next to the old one in /opt, copy your changes from the old etc/hadoop directory, and point the link at the new directory with sudo ln -sfn /opt/hadoop-X.Y.Z /opt/hadoop. Remember to use the matching version number in the name of the examples jar.

Frequently asked questions

Can I run Hadoop 3.5 on Java 8 or Java 11?

No. The 3.5.0 release notes state that Java 17 is required on the server side, and that Java 17 and Java 21 are supported for clients. If an application ties you to an older Java runtime, look at the Hadoop 3.4 line, which is still receiving releases (3.4.3 was published in February 2026), and check the project's Java versions page for what it supports.

Why does the job fail with "Output directory already exists"?

MapReduce never overwrites results. Every job needs an output path that does not exist yet, so delete the old directory or pass a new name. This protects the output of long-running jobs from being destroyed by a repeated command.

Do the same steps work on Ubuntu or Debian?

Yes, apart from the package manager. Install an OpenJDK 17 runtime with apt, set JAVA_HOME to the directory your distribution uses under /usr/lib/jvm, and follow the remaining steps unchanged. Hadoop itself is the same archive on every Linux distribution.

Is stand-alone mode suitable for production data?

No. It has no replication, no resource manager and no parallelism beyond one JVM. Use it for learning, for unit-testing jobs on small samples and for debugging; use a multi-node cluster for real workloads.

Share story:

Continue reading other guides on How VPS.