Explain how a NameNode communicates with a DataNode in HDFS.
💡 Model Answer
In HDFS, the NameNode is the master that stores metadata about the file system namespace and block locations. DataNodes are the workers that store the actual data blocks. Communication occurs over RPC. The NameNode sends heartbeats to each DataNode to confirm it is alive; DataNodes send heartbeats periodically. DataNodes also send block reports to the NameNode, listing the blocks they hold. When a client wants to read or write a file, it contacts the NameNode to get block locations, then communicates directly with the relevant DataNodes to transfer data. The NameNode also instructs DataNodes to replicate blocks to maintain the configured replication factor. This heartbeat and block report mechanism ensures the NameNode has up‑to‑date information about the cluster state.
This answer was generated by AI for study purposes. Use it as a starting point — personalize it with your own experience.
🎤 Get questions like this answered in real-time
Assisting AI listens to your interview, captures questions live, and gives you instant AI-powered answers on a discreet on-screen overlay.
Get Assisting AI — Starts at ₹500