2026-10-31·por Sijie Wang

namenode

NameNode keeps directory tree, block lists and block locations, no file content; a role, not special hardware; one logical NameNode with or without HA.

NameNode: the bookkeeper that holds no data at all

What it keeps: three things, and nothing else. The NameNode stores the directory tree, each file's block list in order, and each block's DataNode locations. It stores no file content at all. If you want an analogy, it is the front desk catalogue of a library: the catalogue tells you which shelf every book is on, but the books themselves are on the shelves, and the catalogue contains no book text. The shelves are the DataNodes.

It is a role, not special hardware. Nothing about a NameNode requires a special kind of machine. In production it usually gets a dedicated ordinary server, dedicated because the metadata lives entirely in memory and needs a lot of RAM — not because the hardware is exotic. In a test setup it can be co-located with other roles. The leader analogy is accurate: like a Raft leader or a Kafka controller, it is a position one machine occupies, with the authority that comes with the position.

One machine, or two? Without high availability, it is literally one machine, and a single point of failure: if it dies, the cluster's map is gone until it restarts (its ledger is persisted, see ledger-persistence, but nothing serves while it is down). With high availability there are two machines, but only one active writer at a time, and the standby keeps its own copy of the ledger in sync. Externally it is still one NameNode: clients use one logical name and do not care which physical machine is active today.

What follows from this shape. Because the ledger is in memory, its capacity is bounded by file count, not data volume — the arithmetic is in block-size-and-metadata-math. Because it holds no data, it never becomes a data bottleneck: reads and writes bypass it entirely, see read-path and write-path. And because it is a single logical authority, every other mechanism in this cluster — leases, safe mode, fencing — exists to protect the one property that matters: there is exactly one writer of this ledger at a time. Those mechanisms are writer-lease, safe-mode and ha-and-fencing.

sobre esta entrada

Una de las entradas de wiki de sijie. La IA en este sitio está anclada en el mismo corpus y responde en la voz de sijie, con citas que vuelven a entradas como esta — responder le cuesta dinero a sijie, así que espera detrás de un código: ingrese código de acceso →