Skip to main content

Modern On-Prem Hadoop & Spark Cluster Setup: Hardware, Layout and Configuration Best Practices

Struggling with delivery, architecture alignment, or platform stability?

I help teams fix systemic engineering issues: processes, architecture, and clarity.
→ See how I work with teams.


A decade ago, Hadoop clusters were fragile, manually assembled and deeply dependent on matching XML configurations across machines. Today, stable HA architectures, Spark-first compute and automated tooling make on-prem Hadoop far more robust. This article modernizes the original 2010 cluster guide while preserving historical snippets to show how dramatically the operational model has evolved.

The Evolution of Hadoop Cluster Setup

In the early 2010s, deploying Hadoop was an exercise in precision and persistence. Every configuration lived in XML, and each file had to match exactly across the cluster. A single typo, whitespace, hostname mismatch or missing environment variable could crash daemons or stop the NameNode from starting. There was no high availability, no centralized config management and very little validation.

To illustrate how things used to be, here are real examples from the Hadoop 0.20 / CDH2 era.

Historical Hadoop XML Configuration (2010 Examples)

core-site.xml

<configuration>
  <property>
    <name>fs.default.name</name>
    <value>hdfs://namenode1:9000</value>
  </property>

  <property>
    <name>hadoop.tmp.dir</name>
    <value>/opt/hadoop/tmp</value>
  </property>
</configuration>

hdfs-site.xml

<configuration>
  <property>
    <name>dfs.name.dir</name>
    <value>/opt/hadoop/hdfs/name</value>
  </property>

  <property>
    <name>dfs.data.dir</name>
    <value>/opt/hadoop/hdfs/data</value>
  </property>
</configuration>

mapred-site.xml (Classic MapReduce)

<configuration>
  <property>
    <name>mapred.job.tracker</name>
    <value>namenode1:54311</value>
  </property>

  <property>
    <name>mapred.local.dir</name>
    <value>/opt/hadoop/hdfs/mapred/local</value>
  </property>
</configuration>

masters and slaves files

# masters
namenode1
# slaves
datanode1
datanode2
datanode3
datanode4

hadoop-env.sh

export JAVA_HOME=/usr/lib/jvm/java-6-sun
export HADOOP_OPTS="-Djava.net.preferIPv4Stack=true"

This is the environment that many early Hadoop operators lived in: fragile XML dependency chains, manual file distribution, init.d scripts on every node and debugging via SSH and tailing logs. Compared to what exists today, it was a completely different world.

Why On-Prem Hadoop Still Matters in 2025

Even with cloud-native platforms dominating new workloads, many organizations continue to run on-prem Hadoop for compliance, cost control, data locality and latency-sensitive workloads. Hadoop, YARN and Spark remain proven building blocks for IoT data lakes, pipeline backbones and large-scale event analytics.

Recommended Hardware for a Modern Small Cluster

  • 2× HA NameNode Masters: 16–32 cores, 128–256 GB RAM, redundant NVMe metadata storage.
  • 1 Gateway Node: For notebooks, ingestion, CLI tools and secure access.
  • 4–20 Worker Nodes: 24–48 cores, 128–256 GB RAM, NVMe or hybrid NVMe+HDD for HDFS.
  • Networking: 25–100 GbE for modern Spark workloads.

Spark shuffle performance and HDFS block throughput improve massively with SSD/NVMe; spinning disks alone are no longer competitive.

Operating System Preparation

Install a Consistent JDK

Use OpenJDK 17 or 21 across all nodes.

Enable Passwordless SSH

Still required for automation, orchestration and bootstrap workflows.

Increase System Limits

# /etc/security/limits.conf
hdfs  soft nofile 100000
hdfs  hard nofile 100000
yarn  soft nofile 100000
yarn  hard nofile 100000
spark soft nofile 100000
spark hard nofile 100000
# /etc/sysctl.conf
fs.file-max=500000
vm.swappiness=1
net.core.somaxconn=65535

Modern HDFS Directory Layout

Use dedicated mount points per disk:

/data01/hdfs
/data02/hdfs
/data03/hdfs
<property>
  <name>dfs.datanode.data.dir</name>
  <value>file:///data01/hdfs,file:///data02/hdfs,file:///data03/hdfs</value>
</property>

<property>
  <name>dfs.namenode.name.dir</name>
  <value>file:///var/lib/hdfs/namenode</value>
</property>

High Availability NameNode Configuration

<property>
  <name>dfs.nameservices</name>
  <value>cluster1</value>
</property>

<property>
  <name>dfs.ha.namenodes.cluster1</name>
  <value>nn1,nn2</value>
</property>

<property>
  <name>dfs.namenode.rpc-address.cluster1.nn1</name>
  <value>namenode1:8020</value>
</property>

<property>
  <name>dfs.namenode.rpc-address.cluster1.nn2</name>
  <value>namenode2:8020</value>
</property>

YARN Resource Manager and Spark Configuration

<property>
  <name>yarn.resourcemanager.address</name>
  <value>rm1:8032</value>
</property>

<property>
  <name>yarn.nodemanager.resource.memory-mb</name>
  <value>131072</value>
</property>

<property>
  <name>yarn.nodemanager.resource.cpu-vcores</name>
  <value>24</value>
</property>
spark.executor.memory=16g
spark.executor.cores=4
spark.executor.instances=6
spark.local.dir=/data01/spark,/data02/spark

Security: Kerberos and TLS

A modern on-prem Hadoop cluster must run with Kerberos authentication, TLS encryption and service keytabs. Ranger or Sentry provides fine-grained access control.

Cluster Startup and Verification

sudo -u hdfs hdfs namenode -format
systemctl start hadoop-hdfs-namenode
systemctl start hadoop-hdfs-datanode
systemctl start hadoop-yarn-resourcemanager
systemctl start hadoop-yarn-nodemanager
systemctl start spark-history-server

Web interfaces:

Why Modern Hadoop Is So Much Easier Than 2010

The contrast to early Hadoop is enormous. Today you get:

  • High Availability NameNodes instead of one point of failure.
  • YARN and Spark instead of classic JobTracker/TaskTracker.
  • Configuration validation and automation via Cloudera Manager or Ansible.
  • systemd instead of fragile init.d scripts.
  • Stable JVMs, faster local disks and predictable startup behavior.

But understanding where Hadoop came from — and how easily early clusters broke — helps you appreciate the architectural discipline still required for a reliable on-prem data lake today.

If you need help with distributed systems, backend engineering, or data platforms, check my Services.

Most read articles

Why Is Customer Obsession Disappearing?

Many companies trade real customer-obsession for automated, low-empathy support. Through examples from Coinbase, PayPal, GO Telecommunications and AT&T, this article shows how reliance on AI chatbots, outsourced call centers, and KPI-driven workflows erodes trust, NPS and customer retention. It argues that human-centric support—treating support as strategic investment instead of cost—is still a core growth engine in competitive markets. It's wild that even with all the cool tech we've got these days, like AI solving complex equations and doing business across time zones in a flash, so many companies are still struggling with the basics: taking care of their customers. The drama around Coinbase's customer support is a prime example of even tech giants messing up. And it's not just Coinbase — it's a big-picture issue for the whole industry. At some point, the idea of "customer obsession" got replaced with "customer automation," and no...

How to scale MySQL perfectly

When MySQL reaches its limits, scaling cannot rely on hardware alone. This article explains how strategic techniques such as caching, sharding and operational optimisation can drastically reduce load and improve application responsiveness. It outlines how in-memory systems like Redis or Memcached offload repeated reads, how horizontal sharding mechanisms distribute data for massive scale, and how tools such as Vitess, ProxySQL and HAProxy support routing, failover and cluster management. The summary also highlights essential practices including query tuning, indexing, replication and connection management. Together these approaches form a modern DevOps strategy that transforms MySQL from a single bottleneck into a resilient, scalable data layer able to grow with your application. When your MySQL database reaches its performance limits, vertical scaling through hardware upgrades provides a temporary solution. Long-term growth, though, requires a more comprehensive approach. This invo...

What the Heck is Superposition and Entanglement?

This post is about superposition and interference in simple, intuitive terms. It describes how quantum states combine, how probability amplitudes add, and why interference patterns appear in systems such as electrons, photons and waves. The goal is to give a clear, non mathematical understanding of how quantum behavior emerges from the rules of wave functions and measurement. If you’ve ever heard the words superposition or entanglement thrown around in conversations about quantum physics, you may have nodded politely while your brain quietly filed them away in the "too confusing to deal with" folder.  These aren't just theoretical quirks; they're the foundation of mind-bending tech like Google's latest quantum chip, the Willow with its 105 qubits. Superposition challenges our understanding of reality, suggesting that particles don't have definite states until observed. This principle is crucial in quantum technologies, enabling phenomena like quantum comp...