Configuring Datanode heartbeat
The Datanodes periodically update the Namenode about its presence or any changes in the blocks. The default Datanode heartbeat time is three seconds. But this does not mean that if a Datanode does not send a heartbeat for, say, 10 seconds, that the node will be marked dead.
In this recipe, we will look at how a heartbeat is configured and the parameters that play a role in its function.
Getting ready
You have a running cluster, and the user is familiar with Datanode communication with Namenode.
How to do it...
ssh to Namenode and edit the
hdfs-site.xml
file to add the following property to it:<property> <name>dfs.heartbeat.interval</name> <value>3</value> </property> <property> <name>dfs.namenode.heartbeat.recheck-interval</name> <value>300000</value> </property>
Copy
hdfs-site.xml
across all nodes in the cluster.Restart HDFS daemons across nodes for the property to take effect:
$ stop-dfs.sh...