FDE Times dataFDE jobs open 932▼14 Change in open roles over 7 days, like-for-like: roles from companies we started tracking this week are left outNew in 7 days 62Companies hiring 202Remote-friendly 24%Median US pay $201kTop hirer Databricks 92
中文VI

The newspaper of the Forward Deployed Engineer

Guides

How to read a bank's old Hadoop cluster without taking it down

An FDE need not become a Hadoop expert: most failures on site come down to where the data lives and who decides what runs.

ShareLinkedInFacebookX

In brief

  • HDFS separates metadata (NameNode) from data (DataNodes); in Hadoop 1.x the NameNode is a single point of failure.
  • YARN decides who gets to run; MapReduce decides how: map, shuffle by key, then reduce.
  • HDFS is write once, read many; for real-time random updates, use HBase.
Diagram of the layers of a Hadoop cluster. HDFS is at the bottom: the NameNode holds the namespace and the location of every block, with an arrow pointing to four DataNodes that only store blocks. YARN sits on top of HDFS, and MapReduce sits on YARN with its map, shuffle, reduce flow. HBase is a separate column standing directly on HDFS. The right-hand column lists four weak spots: the NameNode as a single point of failure, Safemode after a restart, jobs stuck waiting for resources, and thousands of small files. The bottom strip: a 1 GB file becomes 16 blocks of 64 MB, then 48 replicas when replication is 3.
For each layer, ask two questions: where does the data live, and who decides what runs. Three of the four weak spots trace back to the NameNode.

A 1 GB transaction file on an old Hadoop cluster can become 48 block replicas, and one machine has to know where every one of them is. Take a hypothetical FDE on day two at a bank: SSH access to an edge node and a single instruction. The entire transaction history is on the Hadoop cluster, so don’t bring it down.

Nobody on the project team remembers how the cluster was built. The FDE has two weeks to pull data from it and train a fraud detection model.

If you plan to work as an FDE for banks or telecom operators, be ready for a scene like this. You don’t need to become a Hadoop expert. You need to read four components quickly enough to know which parts are safe to touch and which will break.

Four components, two questions: where is the data, and who gets to run?

The easiest way to remember the cluster is as a stack. At the bottom is HDFS, the distributed file system. Above it is YARN, which allocates CPU and memory. On top of YARN is MapReduce, the batch processing model. HBase stands beside the YARN/MapReduce branch and uses HDFS directly for storage.

For each component, answer two questions: where does the data actually live, and who has the authority to decide what runs? Most of the incidents you meet on site come down to one or the other.

How many pieces is a 1 GB file on HDFS?

HDFS has a master/slave architecture. The NameNode holds the namespace and keeps track of every file, its permissions and the location of each block. The DataNodes do one thing: store blocks.

Now do the arithmetic. The Hadoop 1.x documentation gives 64 MB as a typical block size. A 1 GB transaction file, or 1,024 MB, is cut into 16 blocks. With a replication factor of 3, the cluster holds 48 block replicas scattered across DataNodes, and the NameNode must remember the location of all 48.

That number tells you two things. On load, millions of small files mean millions of metadata entries piling up on one NameNode. On durability, HDFS always keeps at least one replica on a different rack, so losing a whole rack does not lose the data.

Replication is set per file and can be changed after the file is created, so don’t assume every directory is equally safe. Newer clusters also tend to use blocks larger than 64 MB. Check the real configuration before trusting a textbook number.

One principle underlies all of this: HDFS is write once, read many. You cannot edit a line in the middle of a file. If your model needs to update a risk score for each customer, HDFS is the wrong place to do it.

Why is the NameNode the first thing to ask about?

In Hadoop 1.x, the machine running the NameNode is a single point of failure for the whole cluster. If the NameNode dies, the DataNodes still have the data, but nobody knows which block belongs to which file.

Another behavior often causes panic. On startup, the NameNode enters Safemode and does not replicate blocks. An old cluster that has just restarted may sit in Safemode for quite a while, and your jobs will fail in confusing ways. Your code is not at fault.

So the first question for the operations team should be: is NameNode HA enabled on this cluster, and how long did the last restart take? The answer tells you the real risk of everything you are about to do.

YARN and MapReduce: what is your job waiting for?

YARN separates resource management from job scheduling and monitoring, and puts them in separate daemons: the ResourceManager, a NodeManager on each machine, and one ApplicationMaster per application. The ResourceManager has the final say on how resources are divided among all applications.

When your job stays in a waiting state, don’t rush to change the code. Look at whom the ResourceManager is giving resources to. At a bank, an end-of-day reconciliation job may well have priority over yours.

MapReduce decides how the work runs. A concrete example is counting transactions by branch. The snippet below is pseudocode in the style of Hadoop Streaming, chosen for readability; native MapReduce jobs are usually written in Java.

# Hadoop Streaming-style pseudocode (native MapReduce is written in Java)

# map: each transaction line -> (branch_code, 1)
def map_fn(line):
    cols = line.split(",")
    yield cols[2], 1

# shuffle: the system gathers all pairs with the same key on one reducer

# reduce: add up the counts per branch
def reduce_fn(branch, counts):
    yield branch, sum(counts)

The map phase turns data into key/value pairs. The shuffle phase sends all pairs with the same key to the same reducer. The reduce phase then receives one branch with its full list of 1s, such as (BR_HN01, [1, 1, 1, ...]), and adds them up into that branch’s transaction total.

If one large branch accounts for most of the transactions, a single reducer has to carry that share, and you will see the whole job waiting on one last task.

The limitation most worth remembering is that MapReduce usually does not keep data in memory between steps. Jobs that iterate many times, such as model training, are therefore much slower than on Spark. Use MapReduce for extraction and aggregation, and keep it out of the training loop.

Hadoop also has a philosophy: move computation to the data instead of moving the data. The reflex to download everything to a laptop or push it to the cloud is often slow and runs into security rules. Filter and aggregate on the cluster, and take only the compact result out.

HBase: when you need to look up one customer now

HDFS does not allow in-place edits, so reading or changing individual records is a job for HBase. It is a non-relational wide-column store modeled on Google’s Bigtable, running on HDFS or Alluxio. It offers real-time random reads and writes, automatic failover and automatic sharding.

For the fraud project, the cleanest split is this. Years of transaction history stay on HDFS for batch training. The latest risk profile for each customer, which must be looked up by key when a transaction arrives, goes in HBase.

Five tasks for your first week on site

First, read the real configuration. A few read-only commands are enough to get started without breaking anything:

hdfs dfsadmin -safemode get
hdfs getconf -confKey dfs.blocksize
hdfs fsck /data/transactions -files -blocks -locations
yarn application -list

Second, ask about NameNode HA and the restart schedule. Third, find out which YARN queue is assigned to your team and when the cluster is quiet. Fourth, map the data: what is on HDFS, what is in HBase, and what replication each directory has. Finally, run a small job on part of the data before touching the full table.

If you are aiming for an FDE role, watch for job descriptions at banks or telecom companies that mention Hadoop, HDFS or HBase. On a résumé, a line such as “read fsck output and handled a cluster stuck in Safemode” is worth far more than “knows Hadoop”.

Familiar stumbles

The most common mistake is writing thousands of small output files to HDFS. Each file adds metadata to the NameNode, on a cluster where the NameNode may be a single point of failure.

Next comes treating HDFS as a database and trying to update individual rows. Others assume the block size is still 64 MB, or that replication is the same everywhere. Some blame the code when the job is really waiting for resources or the cluster is still in Safemode.

The most expensive mistake is not technical. It is running a large job during reconciliation hours without asking anyone. On a cluster the whole bank depends on, the operations team’s trust is harder to recover than any block.

A good FDE on a legacy system does not rewrite it, but understands it well enough to bring out new value without breaking anything that is running.

Was this article useful?

Use with your AI assistantAsk Claude ↗Ask ChatGPT ↗
6 sources
Read next on the roadmap · Stage 2: Broad engineeringA folder of Parquet files on S3 is not a tableS3 cannot update several keys atomically, so a job killed mid-write leaves a half-written table unless Delta Lake, Iceberg or Hudi sits on top.