Why companies run many clusters

Large companies rarely run one Hadoop cluster. They run a fleet: production, a disaster-recovery copy in another region, staging, development and sandboxes, sometimes split by business unit or by country. This lesson explains why, what the clusters must share, what a fleet costs, and builds a two-cluster fleet in our lab, including the mistake we made on the way.

Module 12 · Multiple clusters and operations⏱ 26 minIntermediateTwo real clustersArchitecture diagram + 2 animationsRuns in your browser (Python)8 practice problems
1 The story

One cluster was never going to be enough

The canteen project has grown. The college now wants a second cluster in another city, so that the billing data survives if the main campus loses power for a week. Riya joins the two lab clusters on one Docker network and runs a job. It hangs, retries ten times and fails with Connection refused. The client had asked for resourcemanager and reached the right machine through the wrong network. Both clusters also had a machine called namenode.

Everything joined lab8: namenoderesourcemanager lab5: namenode (!)5 DataNodes resourcemanager → 172.19.0.10 (other network) Connection refused · 10 retries · job fails Distinct names, only workers joined prod (lab8)namenode · 3 workers dr (lab72)nn-canteen · nn-hostel jobs run · DistCp copies 162 MB to DR fleet.py lists both clusters Real, from our lab today. Every second cluster brings naming, networking and copying problems. myphatshala.in
Riya

Sir, why not one giant cluster? We learnt that Hadoop scales to thousands of nodes.

Arjun Sir

It does. But a bank cannot test a Hadoop upgrade on the cluster that settles UPI payments tonight. It needs a copy in another city in case a data centre floods. Its data scientists should not be able to slow the regulator's report. And some data may have to stay in one country. Each of those is a reason for another cluster.

Kabir

At my internship we had seven: prod, DR, staging, dev, two analytics sandboxes, and a tiny one just for upgrade tests.

Arjun Sir

Today we look at why fleets happen, what the clusters share, what they cost, and how a platform team keeps track of them, starting with the tiny fleet in our own lab.

2 Definition

A cluster fleet

Formal definition (write this in exams)

A multi-cluster deployment (or cluster fleet) is a set of independently operated Hadoop clusters, each with its own NameNode(s), ResourceManager and failure domain, run by one organisation for different purposes such as production, disaster recovery, staging and development, tenant or business-unit isolation, data residency and scale. Clusters exchange data through replication tools such as DistCp and share cross-cutting services: identity (Kerberos realms with trust), authorization policies (Apache Ranger), metadata (Hive Metastore, data catalog) and monitoring. Unlike HDFS federation, where several NameNodes share one set of DataNodes and one cluster ID, separate clusters share no storage and fail independently.

In simple words

Companies keep several Hadoop clusters for the same reasons a hospital keeps a backup generator and a separate training room: safety, testing, isolation and rules. The clusters copy data to each other and share logins, permissions and monitoring.

Words you'll meet in this lesson

ProdThe cluster that runs the business; changes are slow and reviewed.
DR clusterA copy in another site that takes over if prod is lost.
StagingA small copy of prod used to test upgrades and new jobs.
TenantA team or business unit sharing a platform.
Data residencyRules that some data must be stored in a given country.
Cross-realm trustTwo Kerberos realms accepting each other's tickets.
Fleet inventoryA live list of every cluster: version, size, health, owner.
Configuration driftClusters that should be alike slowly becoming different.

From our lab (Hadoop 3.5.0, two clusters)

prod (lab8)Cluster ID CID-01fef50a-…, 3 live DataNodes, 1,680 files, 4,769 MB used, with YARN
dr (lab72)Two federated namespaces, canteen (15 files) and hostel (4 files), one cluster ID campus-cluster, 3 DataNodes, 541 MB used
Mistake we madeJoining every lab8 container to the other network: resourcemanager resolved to 172.19.0.10, the client got Connection refused after 10 retries
FixDistinct names per cluster; only the workers (where DistCp maps run) join the second network

Architecture at a glance

A typical fleet of an Indian bank or marketplace. Clusters are separate failure domains; the services along the bottom are shared by all of them.

PROD · Mumbai region 400 nodes · 6 PB payments, orders, nightly ETL HA NameNodes · strict change control DR · Hyderabad region 150 nodes · critical data only receives DistCp every hour takes over in a disaster DistCp -update -diff RPO = time since last sync STAGING upgrade rehearsal masked sample data DEV small, cheap, developers break it ANALYTICS SANDBOX data scientists, ad hoc can't slow prod EPHEMERAL cloud, per job, data in object store sample copy curated tables Kerberos realmswith trust Ranger policieswho may read what Metastore + catalogwhat each table is Monitoringone fleet dashboard myphatshala.in

Sizes are illustrative. Shared services are what make a fleet manageable; without them every cluster becomes its own island.

Many clusters at three levels

Pick your level. New to this? Start at Beginner and climb.

Beginner A school with several buildings

  • The main building holds the exam papers (prod). Nobody practises chemistry experiments there.
  • A lab building lets students break things (dev), and a copy of the records sits in the district office (DR).
  • All buildings use the same ID cards (Kerberos), the same rules about who opens which room (Ranger) and the same register of what is stored where (catalog).

Intermediate The reasons, one by one

  • Safety: a DR cluster in another region survives a data-centre loss. HA (Lesson 7.1) protects against a dead NameNode, not a flooded building.
  • Change control: upgrades, new configs and new jobs are tried on staging first.
  • Isolation: queues (Lesson 11.3) share one cluster's CPU, but a runaway job can still fill HDFS or overload the NameNode. A separate cluster cannot.
  • Rules: some data must stay in a country or a network zone. In India, for example, the RBI requires payment-system data to be stored in India, so a global company may keep a separate Indian cluster (check the current rules with your compliance team).
  • Scale and organisation: one NameNode's memory limits the number of files (Lesson 7.5); mergers and separate budgets bring their own clusters.

Advanced Running a fleet

  • Shared identity: each cluster can have its own Kerberos realm, with cross-realm trust so a user's ticket works everywhere (Lesson 12.5).
  • Shared metadata: one Hive Metastore or catalog per environment so a table means the same thing on prod and DR.
  • Fleet inventory: a script or tool that asks every NameNode and ResourceManager for version, cluster ID, capacity and health (our fleet.py), feeding one dashboard (Lesson 12.4).
  • Configuration as code: generate every cluster's *-site.xml from one repository to stop drift.
  • Unique names: host names, nameservice IDs and cluster IDs must differ across clusters, or clients reach the wrong one, exactly as ours did.

Exam tip: For “Why do organisations run multiple Hadoop clusters?”, list at least four reasons (DR, dev/test/staging, isolation of workloads, data residency, scale), name the tool that moves data between them (DistCp), and mention the shared services (Kerberos, Ranger, metastore, monitoring). Distinguish this from HDFS federation.

3 Types and ways to use it

Kinds of clusters and fleet patterns

ClusterPurposeDataTypical sizeWho may change it
ProductionBusiness jobs with SLAsEverything, realLargestChange board only
Disaster recoveryTake over after a site lossCritical subset, copied30–100% of prodPlatform team
Staging / pre-prodRehearse upgrades and releasesMasked sampleSmall, same versionsPlatform team
DevelopmentBuild and test jobsSynthetic or maskedTinyDevelopers
Analytics sandboxExploration, data scienceCurated copiesMediumAnalysts
Ephemeral (cloud)One job or one dayIn object storageAny, then deletedPipelines

Fleet patterns

Hub and spoke

One central data-lake cluster; business units get spokes with copies of the tables they need.

central data

Cluster per business unit

Retail, cards and loans each run their own; a shared catalog and Ranger keep rules consistent.

isolation

Active–passive DR

Prod in one region, DR in another receiving hourly DistCp (Lesson 12.2).

safety

Compute-only clusters

Storage in S3, ADLS or GCS; clusters start for a workload and stop after (Module 13).

cloud

Federation or another cluster?

HDFS federation (Lesson 7.2)Separate clusters
DataNodesShared by all NameNodesSeparate
Cluster IDOne (campus-cluster in our lab)One per cluster
SolvesNameNode memory and RPC limitsFailure domains, isolation, regions, rules
A flood in the data centreLoses everythingDR cluster survives

Animated example: from one cluster to a fleet

A payments company grows a fleet 6 steps
Animated example prod40 nodes Year 1 · one cluster does everything.Developers test new jobs on it too. dev5 nodes Year 2 · a test job deletes a prod folder.Lesson learnt: developers get their own cluster. DR (other city)20 nodeshourly DistCp Year 3 · the regulator asks for a recovery plan.A DR cluster in another city gets hourly copies. stagingsame versions Year 4 · an upgrade breaks a job on prod.From now on every upgrade is rehearsed on staging. fraud sandboxdata scientists Year 5 · model training slows settlement.The fraud team gets a sandbox with curated copies. shared: KDC,Ranger, catalog 5 clusters, one login, one set of rulesfleet dashboard shows all of them myphatshala.in

A rule of thumb: add a cluster when you need a separate failure domain, a separate change schedule or a separate legal boundary. If you only need fair sharing of CPU and memory, queues (Lesson 11.3) are cheaper.

4 Step by step

Building a two-cluster fleet in the lab

Our “prod” is the Module 8 cluster (lab8, with YARN). Our “DR” is the federation cluster of Lesson 7.2 (lab72). Scripts are in “Run it on your PC”.

  1. First attempt: connect everything

    for c in namenode worker1 worker2 worker3 resourcemanager historyserver; do
      docker network connect lab5_default lab8-$c-1
    done
    hadoop distcp /prod/canteen hdfs://lab5-namenode-1:8020/dr/
    Retrying connect to server: resourcemanager/172.19.0.10:8032. Already tried 9 time(s) java.net.ConnectException: Call From namenode/172.22.0.2 to resourcemanager:8032 failed on connection exception: java.net.ConnectException: Connection refused
    A container on two networks answers to its name on both. The client got the ResourceManager's address on the second network, where nothing listens. Both clusters also had a host called namenode.
  2. Fix: unique names, only workers join

    docker compose -p lab72 start                     # DR: nn-canteen, nn-hostel
    for c in worker1 worker2 worker3; do docker network connect lab72_default lab8-$c-1; done
    docker exec lab8-worker1-1 getent hosts namenode resourcemanager nn-canteen
    172.22.0.2 namenode 172.22.0.3 resourcemanager 172.21.0.2 nn-canteen
    The DR cluster's names (nn-canteen, nn-hostel) do not clash with prod's. Prod names still resolve to prod's network.
  3. Take inventory of the fleet

    python3 /tmp/fleet.py
    cluster version clusterId live DNs files used prod (lab8) 3.5.0 CID-01fef50a-2caf-4bfb-9422-ad32ed9b0cb4 3 1680 4769 MB dr (lab72) ns canteen 3.5.0 campus-cluster 3 15 541 MB dr (lab72) ns hostel 3.5.0 campus-cluster 3 4 541 MB
    Two clusters, three NameNodes. The two DR namespaces share a cluster ID because they are federated over the same DataNodes (Lesson 7.2); prod has its own, so it fails independently.
  4. What the fleet needs next

    copy data prod → DR            DistCp, snapshots           Lesson 12.2
    size each cluster              measured throughput          Lesson 12.3
    watch every cluster            JMX/REST + alerts            Lesson 12.4
    one identity, one rule book    Kerberos, Ranger             Lesson 12.5
    known fixes for known faults   runbooks                     Lesson 12.6
    The rest of this module turns our two-cluster lab into a small but properly operated fleet.

Never let two clusters share a host name, nameservice ID or cluster ID by accident. Clients, DistCp and DataNodes will happily talk to the wrong one, and the error (if any) points somewhere else.

5 See it happen

Two clusters, one network mistake

Six steps from our lab: the wrong way to join clusters, the fix, and the first fleet report.

Joining two clusters 6 steps
What you see you@pc : mr-lab $ docker network connect lab5_default …(all 6 lab8 containers joined) $ hadoop distcp /prod/canteen …Retrying connect to server:resourcemanager/172.19.0.10:8032Connection refused $ docker network disconnect … (all)$ docker compose -p lab72 startnn-canteen, nn-hostel up $ network connect lab72 worker1..3172.22.0.3 resourcemanager172.21.0.2 nn-canteen $ python3 fleet.pyprod 3.5.0 3 DNs 1680 filesdr/canteen 3.5.0 15 filesdr/hostel 3.5.0 4 files $ hadoop distcp /prod/canteen \ hdfs://nn-canteen:8020/dr/Files Copied=5Bytes Copied=169964453 myphatshala.in
Behind the screen network lab8 (172.22) second network namenode RM w1 w2 w3 lab5: namenode (same name!)+ RM's 2nd address 172.19.0.10 "resourcemanager" → the address where nothing listens every container now has two addresses and two sets of names lab72: nn-canteen, nn-hostel3 DataNodes distinct names: nothing in DR is called namenode workers reach both RM and NameNode stay on one network only fleet.py asks 3 NameNodes' JMX/jmx?qry=…NameNodeInfoone script, every cluster DistCp maps on workersmap tasks read prod blocks, write DR blocks myphatshala.in
6 Real-world use

Fleets at work

prod → DR

1. Banking: prod and DR in two cities

Banks keep a recovery copy of critical data in a second region and rehearse failover regularly; auditors ask for proof of the drills.

Prod (Mumbai)→Hourly DistCp→DR (Hyderabad)
sale-day prod

2. E-commerce: isolating the sale-day pipeline

During a big sale, order and inventory pipelines run on a cluster that analysts cannot touch; experiments go to a sandbox fed with curated copies.

Orders→Prod cluster→Sandbox copies
INdata stays here

3. Payments: data residency

Global payment companies keep Indian payment data on clusters in India to meet RBI's storage rule, while other regions run their own clusters.

Indian payments→India cluster→Aggregates only abroad
3.33.5

4. Telecom: blue-green upgrades

An operator builds a new cluster on the new Hadoop version, copies data and moves jobs one by one, keeping the old cluster as a fallback for a month.

Old cluster→Copy + move jobs→New cluster
per-job cluster

5. Media and research: ephemeral clusters

Video and genomics teams start a cloud cluster for a nightly batch over data in object storage and delete it after, paying only for hours used.

Object storage→Cluster for 3 hours→Results, cluster gone

Simplified; organisations differ in tools, policies and regulations.

7 Run the code

A fleet inventory and a cluster decision helper

The first part mimics fleet.py: one record per NameNode, then a summary per cluster ID (federated namespaces share one). The second part turns the reasons from this lesson into a simple decision helper.

fleet = [  # what fleet.py printed in our lab
    {"name": "prod (lab8)", "cluster": "CID-01fef50a", "version": "3.5.0", "dns": 3, "files": 1680, "used_mb": 4769},
    {"name": "dr ns canteen", "cluster": "campus-cluster", "version": "3.5.0", "dns": 3, "files": 15, "used_mb": 541},
    {"name": "dr ns hostel", "cluster": "campus-cluster", "version": "3.5.0", "dns": 3, "files": 4, "used_mb": 541},
]
clusters = {}
for nn in fleet:
    c = clusters.setdefault(nn["cluster"], {"namenodes": 0, "files": 0, "used_mb": nn["used_mb"], "dns": nn["dns"]})
    c["namenodes"] += 1
    c["files"] += nn["files"]
for cid, c in clusters.items():
    print(f"{cid:15} {c['namenodes']} NameNode(s)  {c['dns']} DataNodes  {c['files']:>5} files  {c['used_mb']:>5} MB")
versions = {nn["version"] for nn in fleet}
print("versions in the fleet:", versions, "-> no drift" if len(versions) == 1 else "-> DRIFT")
CID-01fef50a 1 NameNode(s) 3 DataNodes 1680 files 4769 MB campus-cluster 2 NameNode(s) 3 DataNodes 19 files 541 MB versions in the fleet: {'3.5.0'} -> no drift
  • c = clusters.setdefault(nn["cluster"], {"namenodes": 0, "files": 0, "used_mb": nn["used_mb"], "dns": nn["dns"]})Federated namespaces share DataNodes and the cluster ID, so we count their storage once.
  • versions = {nn["version"] for nn in fleet}A fleet report always checks for version drift: one forgotten cluster on an old release is a classic incident.

Run it on your PC: a two-cluster fleet

Start the Module 8 lab (prod) and the Lesson 7.2 federation lab (DR). join_clusters.sh connects only the prod workers to the DR network, then fleet.py runs on a worker, which can see both clusters. Run docker cp fleet.py lab8-worker1-1:/tmp/ first.

Join the clusters and take inventory

# fleet.py: an inventory of every cluster we run - the first thing a platform team builds.
import json, urllib.request
NAMENODES = {"prod (lab8)": "http://namenode:9870",
             "dr (lab72) ns canteen": "http://nn-canteen:9870",
             "dr (lab72) ns hostel": "http://nn-hostel:9870"}
def jmx(base, name):
    return json.load(urllib.request.urlopen(f"{base}/jmx?qry=Hadoop:service=NameNode,name={name}", timeout=5))["beans"][0]
print(f"{'cluster':24} {'version':8} {'clusterId':38} {'live DNs':>8} {'files':>7} {'used':>9}")
for name, base in NAMENODES.items():
    info, st = jmx(base, "NameNodeInfo"), jmx(base, "FSNamesystemState")
    print(f"{name:24} {info['Version'].split(',')[0]:8} {info['ClusterId']:38} {st['NumLiveDataNodes']:>8} "
          f"{st['FilesTotal']:>7} {st['CapacityUsed'] / 2**20:>7.0f} MB")

# ---- join_clusters.sh (run on your PC) ----
# # join_clusters.sh: let the lab8 workers (where DistCp's map tasks run) reach the second cluster.
# # Only the workers join: the clusters both use names like "namenode", and a container on two networks
# # can answer to the wrong address. Run on your PC.
# docker compose -p lab72 start                       # the Lesson 7.2 federation cluster = our "DR" site
# for c in worker1 worker2 worker3; do docker network connect lab72_default lab8-$c-1; done
# docker exec lab8-worker1-1 getent hosts namenode resourcemanager nn-canteen
# docker cp lab8-namenode-1:/tmp/mr/mr.jar /tmp/mr.jar && docker cp /tmp/mr.jar lab8-worker1-1:/tmp/mr.jar

# Then:
#   docker cp fleet.py lab8-worker1-1:/tmp/
#   docker exec lab8-worker1-1 python3 /tmp/fleet.py
cluster version clusterId live DNs files used prod (lab8) 3.5.0 CID-01fef50a-2caf-4bfb-9422-ad32ed9b0cb4 3 1680 4769 MB dr (lab72) ns canteen 3.5.0 campus-cluster 3 15 541 MB dr (lab72) ns hostel 3.5.0 campus-cluster 3 4 541 MB

Real output. Your cluster IDs and file counts will differ. If a job fails with “Connection refused” to an address you don't recognise, a container that runs a server (NameNode, ResourceManager) has joined a second network: disconnect it.

8 Line by line

Grouping NameNodes into clusters

Three NameNodes, two clusters: the cluster ID decides which ones belong together.

Worked examples: real problems, solved and traced in memory

Four fleet decisions from different industries: when to add a cluster, what DR costs, and how many clusters to run.

Example 1BeginnerDecision · retail

Queue or cluster for the analysts?

Problem statement

A retail chain's analysts run heavy ad-hoc queries on the production cluster. Twice this month they filled HDFS with temporary tables and nightly sales loads failed. Is a separate YARN queue enough?

Input
problem: full HDFS, not CPU
Expected output
HDFS filled            -> space quota
CPU contention         -> queue

Approach

  1. Queues share CPU and memory, not HDFS space or NameNode load.
  2. A space quota on their folder would stop the disk problem.
  3. If they also need different versions or tools, give them a sandbox cluster.

Solution: run it live

What happens in memory, step by step

Recorded from a real Python run: press Next to execute one line at a time. Watch variables change in each frame, and lists and dictionaries (numbered #1, #2 …) fill up as objects.

Example 2IntermediateDR · bank

How big must the DR cluster be?

Problem statement

A bank's prod cluster stores 3 PB of data (before replication). Regulators require that 25% of it, the critical tables, be restorable in another city. DR uses replication 3, disks are 80% fillable. How much raw disk does DR need?

Input
3 PB · 25% critical · replication 3 · 80% fill
Expected output
critical data 0.75 PB -> 2.81 PB of raw disk in the DR cluster

Approach

  1. Critical data = 3 × 0.25.
  2. Raw = data × replication.
  3. Divide by the fill limit.

Solution: run it live

What happens in memory, step by step

Recorded from a real Python run: press Next to execute one line at a time. Watch variables change in each frame, and lists and dictionaries (numbered #1, #2 …) fill up as objects.

Example 3IntermediateChange control · telecom

Rehearse the upgrade

Problem statement

An upgrade on a telecom operator's prod cluster takes 6 hours of downtime if done in place, with a 20% chance of a failed job that costs another 4 hours. A blue-green move to a new cluster costs 2 hours of cut-over. Which has the smaller expected downtime?

Input
in place 6 h + 20% × 4 h · blue-green 2 h
Expected output
in place 6.8 h expected downtime, blue-green 2 h (plus a second cluster for a month)

Approach

  1. Expected in place = 6 + 0.2 × 4.
  2. Blue-green = 2 (old cluster kept as fallback).
  3. Compare.

Solution: run it live

What happens in memory, step by step

Recorded from a real Python run: press Next to execute one line at a time. Watch variables change in each frame, and lists and dictionaries (numbered #1, #2 …) fill up as objects.

Example 4AdvancedFleet design · e-commerce

How many clusters for a marketplace?

Problem statement

A marketplace needs: an order pipeline with a 99.9% SLA, a regulator-mandated copy in another city, data scientists training models nightly, developers, and an India-only rule for payment data (all its data is Indian). Propose the fleet and count clusters.

Input
5 needs
Expected output
['dev', 'dr', 'prod', 'sandbox'] -> 4 clusters, plus staging for upgrades = 5

Approach

  1. Map each need to “new cluster” or “share an existing one”.
  2. India-only is already satisfied if all clusters are in India.
  3. Count.

Solution: run it live

What happens in memory, step by step

Recorded from a real Python run: press Next to execute one line at a time. Watch variables change in each frame, and lists and dictionaries (numbered #1, #2 …) fill up as objects.

9 Quiz and revision

Check yourself

Quick revision

Lesson 12.1 in one screen

  • A fleet = several independent clusters: prod, DR, staging, dev, sandboxes, ephemeral cloud clusters.
  • Reasons: site failure (DR), change control (staging), isolation, data residency (e.g. RBI payment-data storage in India), NameNode scale, mergers, budgets.
  • Queues share compute; quotas limit space; only a separate cluster gives a separate failure domain.
  • Shared services: Kerberos realms with trust, Ranger, Hive Metastore/catalog, monitoring.
  • Federation (7.2) = one cluster ID, shared DataNodes; separate clusters fail independently.
  • Lab: prod CID-01fef50a (3 DNs, 1,680 files) + DR campus-cluster (2 namespaces); joining every container to both networks broke name resolution.
  • Unique host names, nameservice IDs and cluster IDs across the fleet; configuration as code to avoid drift.

Interview and viva questions

Why do companies run multiple Hadoop clusters?

To survive the loss of a data centre (a DR cluster in another region), to test upgrades and code safely (staging and development clusters), to isolate workloads that interfere with each other, to meet data-residency rules, to work around the scale limits of one NameNode, and for organisational reasons such as mergers or separate budgets. Data moves between them with DistCp, and they share identity, authorization and metadata services.

What is the difference between HDFS federation and multiple clusters?

Federation runs several NameNodes over one shared set of DataNodes with one cluster ID, to scale the namespace. Multiple clusters have separate NameNodes, DataNodes and cluster IDs, so they fail independently and can be in different places, versions or legal zones.

What is a disaster recovery cluster in Hadoop?

A second cluster, usually in another region, that receives regular copies of critical data (with DistCp, often snapshot-based) and can take over the important jobs if the production site is lost. Its recovery point is the time since the last successful copy.

How do users log in to many Hadoop clusters?

Each cluster uses Kerberos, either in one shared realm or in separate realms with cross-realm trust, so a user's ticket is accepted on every cluster. Authorization is kept consistent with central Ranger policies.

Is it better to have one big cluster or many small ones?

One big cluster uses hardware more efficiently and keeps data in one place; many clusters give isolation, separate change schedules, DR and legal separation at the cost of copies and operational work. Most large organisations combine a few big shared clusters with smaller special-purpose ones.

Practice problems

Fleet exercises using our lab numbers and realistic company scenarios.

P1Easy

Count the fleet

From the fleet report, how many clusters and how many NameNodes are there?

Input
3 lines, 2 cluster IDs
Expected output
2 clusters, 3 NameNodes
Show solution and explanation
ids = ["CID-01fef50a", "campus-cluster", "campus-cluster"]
print(len(set(ids)), "clusters,", len(ids), "NameNodes")
2 clusters, 3 NameNodes

How it works: 2 clusters and 3 NameNodes: the DR cluster is federated with two namespaces.

P2Easy

Files per cluster

Add up the files per cluster ID.

Input
1,680 · 15 · 4
Expected output
prod: 1680 dr: 19
Show solution and explanation
print("prod:", 1680, "dr:", 15 + 4)
prod: 1680 dr: 19

How it works: prod 1,680 and DR 19 files: DR holds only what we chose to protect.

P3Easy

Queue, quota or cluster?

Classify: (a) one team uses all CPU at night, (b) one team fills the disks, (c) the company must survive a city-wide power cut.

Input
3 needs
Expected output
CPU at night         -> queue
fills the disks      -> space quota
city-wide power cut  -> DR cluster
Show solution and explanation
for need, fix in [("CPU at night", "queue"), ("fills the disks", "space quota"), ("city-wide power cut", "DR cluster")]:
    print(f"{need:20} -> {fix}")
CPU at night -> queue fills the disks -> space quota city-wide power cut -> DR cluster

How it works: Use the cheapest tool that actually separates the thing that interferes.

P4Medium

Name clash detector

Given host names per cluster, report any host name used by more than one cluster.

Input
3 clusters
Expected output
{'namenode': ['lab8', 'lab5'], 'datanode': ['lab5', 'lab72']}
Show solution and explanation
clusters = {"lab8": ["namenode", "resourcemanager", "worker1"], "lab5": ["namenode", "datanode"],
            "lab72": ["nn-canteen", "nn-hostel", "datanode"]}
seen = {}
for c, hosts in clusters.items():
    for h in hosts:
        seen.setdefault(h, []).append(c)
print({h: cs for h, cs in seen.items() if len(cs) > 1})
{'namenode': ['lab8', 'lab5'], 'datanode': ['lab5', 'lab72']}

How it works: namenode (lab8, lab5) and datanode (lab5, lab72) clash. Our lab hit the first one.

P5Medium

Copies make a fleet expensive

Prod: 2 PB of data. DR copies 50%, sandbox 15%, staging 1%, all with replication 3. Raw disk for the fleet?

Input
2 PB · shares
Expected output
9.96 PB raw
Show solution and explanation
data = 2.0
shares = {"prod": 1.0, "dr": 0.5, "sandbox": 0.15, "staging": 0.01}
print(f"{sum(data * s * 3 for s in shares.values()):.2f} PB raw")
9.96 PB raw

How it works: 9.96 PB raw for 2 PB of data: copies are the hidden cost of a fleet.

P6Medium

Version drift

Find clusters not on the majority version.

Input
5 clusters
Expected output
majority 3.5.0 | drifted: ['dev', 'sandbox']
Show solution and explanation
from collections import Counter
v = {"prod": "3.5.0", "dr": "3.5.0", "staging": "3.5.0", "dev": "3.4.1", "sandbox": "3.3.6"}
major = Counter(v.values()).most_common(1)[0][0]
print("majority", major, "| drifted:", [c for c, x in v.items() if x != major])
majority 3.5.0 | drifted: ['dev', 'sandbox']

How it works: dev and sandbox have drifted; jobs tested there may behave differently on prod.

P7Business problem

Is a DR cluster worth it?

A day of lost payment data costs an estimated ₹40 crore; the chance of losing the site in a year is 1%. A DR cluster costs ₹1.2 crore a year. Compare expected loss and cost (illustrative).

Input
₹40 crore · 1% · ₹1.2 crore
Expected output
expected loss Rs 0.4 crore/year vs DR Rs 1.2 crore/year
Show solution and explanation
expected_loss = 40 * 0.01
print(f"expected loss Rs {expected_loss:.1f} crore/year vs DR Rs 1.2 crore/year")
expected loss Rs 0.4 crore/year vs DR Rs 1.2 crore/year

How it works: ₹0.4 crore expected loss looks smaller, but regulators require DR anyway, and the 1% event would be existential. Risk decisions are not only averages.

P8Advanced

Ephemeral or always-on?

A nightly job needs 50 nodes for 3 hours. An always-on cluster costs ₹60 per node-hour; an ephemeral cloud cluster ₹90 per node-hour plus 15 minutes of start-up. Monthly cost of each (30 nights)?

Input
50 nodes · 3 h · ₹60 vs ₹90
Expected output
always-on Rs 2,160,000, ephemeral Rs 438,750 per month
Show solution and explanation
always = 50 * 24 * 30 * 60
ephemeral = 50 * (3 + 0.25) * 30 * 90
print(f"always-on Rs {always:,.0f}, ephemeral Rs {ephemeral:,.0f} per month")
always-on Rs 2,160,000, ephemeral Rs 438,750 per month

How it works: ₹21.6 lakh vs ₹4.4 lakh: for a few hours a day, an ephemeral cluster is far cheaper even at a higher hourly rate.

Real-world scenario questions (asked in company interviews)

Fleet questions appear in senior data-engineering and platform interviews.

Architecture · basicsFresher

“Why would a company need more than one Hadoop cluster?”

A common opening question for platform roles.

The interviewer is checking: breadth of reasons.

Show a strong answer
  • Disaster recovery in another region; dev/test/staging for safe changes.
  • Isolation of critical workloads from ad-hoc ones; data residency; NameNode scale limits.
  • Data moves with DistCp; identity, Ranger policies and metadata are shared.
Design · trade-offsExperienced

Analysts keep breaking the nightly pipeline

Ad-hoc queries on prod fill HDFS and slow the NameNode at night.

The interviewer is checking: choosing the cheapest effective isolation.

Show a strong answer
  • Queues for compute, space and name quotas for their folders as a first step.
  • If NameNode load or tooling needs differ, a sandbox cluster fed with curated copies.
  • Keep one catalog and Ranger policies so tables mean the same thing in both.
Operations · incidentExperienced

After connecting two clusters, jobs fail with “Connection refused”

The RM is up; the error names an IP nobody recognises.

The interviewer is checking: networking and naming in multi-cluster setups.

Show a strong answer
  • Check what the host name resolves to on the client; a multi-homed server may be reached on an address it doesn't listen on.
  • Use unique host names and nameservice IDs per cluster; bind servers to 0.0.0.0 or set bind-host properties if multi-homing is required.
  • Only give the machines that need it (workers running copies) access to both networks.
Governance · fleetLead

Seven clusters, four Hadoop versions, nobody knows which

You take over a platform team after an incident on a forgotten cluster.

The interviewer is checking: fleet management habits.

Show a strong answer
  • Build an inventory from each NameNode/RM (version, cluster ID, capacity, owner) and a single dashboard.
  • Configuration as code, one release train, staging rehearsal for every upgrade.
  • Retire or merge clusters without a clear purpose; document DR drills.