# Heartbeat in Hadoop

In Hadoop, a heartbeat is a signal sent from a node to the Hadoop ResourceManager (for the cluster) or the Hadoop NameNode (for the Hadoop Distributed File System, HDFS). The purpose of these heartbeats is to inform the master node that the worker node is alive and functioning properly. This allows the master node to keep track of the health and availability of each worker node in the cluster.

Specifically, there are two types of heartbeats in Hadoop:

1. Node Manager Heartbeat
    
2. DataNode Heartbeat
    

## ResourceManager Heartbeat

In a Hadoop YARN cluster, the NodeManager running on each worker node sends heartbeats to the ResourceManager. These heartbeats contain information about the available resources, the number of containers running on the node, and the overall health status of the node. The ResourceManager uses this information to manage resource allocation and scheduling tasks efficiently across the cluster.

## DataNode Heartbeat

In a Hadoop HDFS cluster, the DataNode running on each worker node sends heartbeats to the NameNode. These heartbeats indicate that the DataNode is alive and operational. Additionally, the DataNode heartbeats also carry information about the block report, which includes a list of all the blocks stored on that particular DataNode. This helps the NameNode maintain the block-to-node mapping and detect any potential data availability issues.

> ***Do you want to*** [***connect with me***](https://www.linkedin.com/in/naveen-pn/) ***I have started mentoring for career and interviews at*** [***𝐭𝐨𝐩𝐦𝐚𝐭𝐞.𝐢𝐨/𝐧𝐚𝐯𝐞𝐞𝐧𝐩𝐧***](https://topmate.io/naveenpn)
