Heartbeats carry information about total storage capacity, fraction of storage in use, and the number of data transfers currently in progress. Heartbeats also carry information about total and used disk capacity and the number of data transfers currently performed by the node, which plays an important role in the name-node’s space and load balancing decisions. These statistics are used for the Name Node’s space allocation and load balancing decisions. The Name Node can process thousands of heartbeats per second without affecting other Name Node operations.
Name Node considers Data Nodes as alive as long as it receives Heartbeat message (default Heartbeat interval is three seconds) from Data Nodes. If the Name Node does not receive a heartbeat from a Data Nodes in XX minutes the Name Node considers the Data Nodes as dead and stops forwarding IO request to it. The Name Node then schedules the creation of new replicas of those blocks on other Data Nodes.
The NameNode can process thousands of heartbeats per second without affecting other NameNode operations. The data nodes send regular heartbeats to the name node so the name node can detect data node failure. During normal operation DataNodes send heartbeats to the NameNode to confirm that the DataNode is operating and the block replicas it hosts are available. The default heartbeat interval is three seconds. If the name node does not receive heartbeats from data nodes for a predetermined period, it marks them as dead and does not forward any new read, write or replication requests to them. The NameNode then schedules creation of new replicas of those blocks on other DataNodes.
The heartbeat message includes the BlockReport from the data node. By design, the name node never initiates any remote procedure calls (RPCs). Instead, it only responds to RPC requests issued by data nodes or clients. It replies to heartbeats with replication requests for the specific data node. Heartbeats from a DataNode also carry information about total storage capacity, fraction of storage in use, and the number of data transfers currently in progress. These statistics are used for the NameNode’s space allocation and load balancing decisions.