Hadoop3:HDFS中DataNode与NameNode的工作流程

一、DataNode中的数据情况

数据位置

bash 复制代码
/opt/module/hadoop-3.1.3/data/dfs/data/current/BP-823420375-192.168.31.102-1714395693863/current/finalized/subdir0/subdir0

块信息

每个块信息,由两个文件保存,xxx.meta保存的是数据长度、校验和、时间戳,另外一个是保存真实数据内容的。

二、工作流程

DataNodeNameNode的工作流程比较简单,主要内容是:DN向NN注册DN定时向NN汇报状态

1、周期上报的相关默认配置

hdfs-default.xml

上报NN时间配置

xml 复制代码
<property>
  <name>dfs.blockreport.intervalMsec</name>
  <value>21600000</value>
  <description>Determines block reporting interval in milliseconds.</description>
</property>

DN自查时间配置

xml 复制代码
<property>
  <name>dfs.datanode.directoryscan.interval</name>
  <value>21600s</value>
  <description>Interval in seconds for Datanode to scan data directories and
  reconcile the difference between blocks in memory and on the disk.
  Support multiple time unit suffix(case insensitive), as described
  in dfs.heartbeat.interval.
  </description>
</property>

一般,这两个配置时间是一样的,工作流程是,DN先自查,然后,将结果汇报给NN

2、超时时长相关默认配置

计算公式

心跳时间配置

xml 复制代码
<property>
  <name>dfs.heartbeat.interval</name>
  <value>3s</value>
  <description>
    Determines datanode heartbeat interval in seconds.
    Can use the following suffix (case insensitive):
    ms(millis), s(sec), m(min), h(hour), d(day)
    to specify the time (such as 2s, 2m, 1h, etc.).
    Or provide complete number in seconds (such as 30 for 30 seconds).
  </description>
</property>

心跳检测时间参数

xml 复制代码
<property>
  <name>dfs.namenode.heartbeat.recheck-interval</name>
  <value>300000</value>
  <description>
    This time decides the interval to check for expired datanodes.
    With this value and dfs.heartbeat.interval, the interval of
    deciding the datanode is stale or not is also calculated.
    The unit of this configuration is millisecond.
  </description>
</property>
相关推荐
QYR_1113 分钟前
宠物车载安全座椅市场报告:解读行业趋势与投资前景
大数据·人工智能
Leo.yuan37 分钟前
实时数据仓库是什么?数据仓库设计怎么做?
大数据·数据库·数据仓库·数据分析·spark
@BreCaspian1 小时前
Git 推送失败解决教程——error: failed to push some refs to
大数据·git·elasticsearch
郭泽元4 小时前
递归树形菜单:优雅处理层级数据的利器
大数据
viperrrrrrrrrr74 小时前
大数据学习(130)-zookeeper
大数据·学习·zookeeper
火龙谷5 小时前
【hadoop】Davinci数据可视化工具的安装部署
大数据·hadoop·分布式
国际云5 小时前
腾讯云国际版和国内版账户通用吗?一样吗?为什么?
大数据·运维·阿里云·云计算
£菜鸟也有梦5 小时前
从0到1,带你走进Flink的世界
大数据·hadoop·flink·spark
Data-Miner6 小时前
可编辑PPT | 基于大数据中台新能源智能汽车应用解决方案汽车大数据分析与应用解决方案
大数据·汽车
武子康7 小时前
Java-39 深入浅出 Spring - AOP切面增强 核心概念 通知类型 XML+注解方式 附代码
xml·java·大数据·开发语言·后端·spring