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

Building a Model-Agnostic Multi-Agent System with OpenClaw

Over one week we rebuilt our AI stack around OpenClaw’s multi-agent architecture to avoid provider lock-in and stop wasting premium tokens. By aligning models to tasks, diversifying fallbacks across providers, enforcing minimal tool access, and switching to memory-first workflows with ephemeral sessions, we reduced token usage per task by about 70% and cut our monthly bill by 77% while improving operational resilience. How We Achieved 77% Cost Reduction and Provider Independence Over the past week, we rebuilt our AI infrastructure around OpenClaw’s multi-agent architecture. The result was a 77% cost reduction , provider independence , and a delegation system that routes work to the most cost-effective model for each job. Below is the technical journey of optimizing a 7-agent squad with OpenClaw. The Challenge: Model Provider Lock-In We started with a simple problem: our entire squad defaulted to a single model provider. This created three issues: Cost inefficiency beca...

BacNet => MQTT in Production: The Real Cost of Bridging BACnet to MQTT at Scale

bacnet2mqtt looks simple in a README and expensive in production. Once BACnet polling, reconnection behavior, stale state, and MQTT publishing collide, teams discover they are not deploying a lightweight adapter but operating infrastructure. This article breaks down where bacnet2mqtt works, where it becomes a bottleneck, and which production patterns reduce the operational damage before incidents, backlogs, and silent data loss turn a building integration into a long-running engineering problem. I inherited a building controls integration problem 18 months ago. Three office floors. 217 BACnet sensors covering temperature, occupancy, and HVAC actuators. The data was trapped inside the building automation network while the business wanted analytics, reporting, and compliance visibility in the data platform. The obvious answer looked easy enough: deploy bacnet2mqtt, bridge BACnet into MQTT, and push the stream into the lakehouse stack. The repository made it sound like a w...

Get Apache Flume 1.3.x running on Windows

Since we found an increasing interest in the flume community to get Apache Flume running on Windows systems again, I spent some time to figure out how we can reach that. Finally, the good news - Apache Flume runs on Windows. You need some tweaks to get them running. Prerequisites Build system: maven 3x, git, jdk1.6.x, WinRAR (or similar program) Apache Flume agent: jdk1.6.x, WinRAR (or similar program), Ultraedit++ or similar texteditor Tweak the Windows build box 1. Download and install JDK 1.6x from Oracle 2. Set the environment variables    => Start - type " env " into the search box, select " E dit system environment variables ", click Environment Variables, Select " New " from the " Systems variables " box, type " JAVA_HOME " into " variable name " and the path to your JDK installation into "Variable value" (Example:  C:\Program Files (x86)\Java\jdk1.6.0_33 ) 3. Download maven from Apache 4. Set...