- Hadoop 2.x Administration Cookbook
- Gurmukh Singh
- 291字
- 2021-07-09 20:10:30
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 $ start-dfs.sh
How it works...
These parameters are default parameters, which control how often the Datanodes send updates and when a Datanode will expire or be marked dead. Remember that dfs.heartbeat.interval
is in seconds and the dfs.heartbeat.interval
parameter is in milliseconds.
So, when a Datanode is dead, for any reason, it will take 10 minutes and 30 seconds for Namenode to mark it as dead. This is not true whenever a graceful removal of a node is performed, as discussed in Chapter 1, Hadoop Architecture and Deployment. There are a lot of factors that govern when a Namenode marks a Datanode as dead and how quickly it does this. But, if the user simply shuts down a Datanode and executes hdfs dfsadmin –report
, the node will still be seen there. The formula that defines when a Datanode is marked as stale is as follows:
Datanode Removal time = (2 x dfs.namenode.heartbeat.recheck-interval ) + (10 X dfs.heartbeat.interval
- Word 2000、Excel 2000、PowerPoint 2000上機指導與練習
- 中文版Photoshop CS5數碼照片處理完全自學一本通
- Python Artificial Intelligence Projects for Beginners
- Visual C# 2008開發技術實例詳解
- 數據庫原理與應用技術
- Photoshop CS3圖像處理融會貫通
- Docker High Performance(Second Edition)
- Moodle Course Design Best Practices
- 網絡化分布式系統預測控制
- 人工智能實踐錄
- Extending Ansible
- 人工智能云平臺:原理、設計與應用
- 計算機辦公應用培訓教程
- 中文版Photoshop情境實訓教程
- 渲染王3ds Max三維特效動畫技術