当前位置:网站首页>DataNode进入Stale状态问题排查
DataNode进入Stale状态问题排查
2022-06-23 16:08:00 【Java小田】
先说下DataNode为啥会处于Stale状态
默认情况下,DataNode每3s向NameNode发送一次心跳,如果NameNode持续30s没有收到心跳,就把DataNode标记为Stale状态;再过10分钟还没收到心跳,就标记为dead状态
NameNode有个jmx指标hadoop_namenode_numstaledatanodes,进入statle状态的DataNode数量,正常情况这个值应该是0,如果不是0则应该触发告警
DataNode有个jmx指标hadoop_datanode_heartbeatstotalnumops,表示心跳发送次数,通过prometheus函数increase(hadoop_datanode_heartbeatstotalnumops[1m]),可以得出1分钟内的心跳发送次数
监控发现有个节点存在心跳次数为0的情况:
观察这段时间DataNode的JVM状态,发现GC非常频繁,1分钟高达90次:
再查看这个节点的日志,发现有一条警告日志:

主要代码在org.apache.hadoop.hdfs.server.datanode.DirectoryScanner.scan()
大致是DataNode会定期扫描磁盘上的数据块,检查是否和内存中的数据块信息一致。开始对比前要先获取锁,完成后释放锁时会进行一个检查,如果持有锁的时间超过阈值(300ms),就会打印警告日志
这里锁持有时间为36s,有点太长了,猜测原因是DataNode存储配置不合理,只配置了一块磁盘,且数据量较大,数据块非常多,导致对比耗时比较久
而这个时间和DataNode心跳缺失的时间也正好相符
抽查了几次出现心跳发送异常的时间点,都有发现这个警告日志
大概率就是因为这个影响到心跳发送
官方也有对应的issue:
https://www.mail-archive.com/[email protected]/msg43698.html
https://issues.apache.org/jira/browse/HDFS-16013
https://issues.apache.org/jira/browse/HDFS-15415
在3.2.2, 3.3.1, 3.4.0版本中解决了这个问题,除了优化性能,最关键是把锁去掉了,及时耗时再久,也不会因为长时间持有锁而影响DataNode健康状态
升级版本对我们来说难度比较大
先继续观察,看这个情况会不会造成其他更大的影响
除了升级版本,把DataNode改为多个目录,每个目录一块较小的磁盘,应该也能起到优化效果
参考文章:
如何识别datanode stale
边栏推荐
- golang日期时间time包代码示例: 根据生日获取年龄、生肖、星座
- Opengauss database source code analysis series articles -- detailed explanation of dense equivalent query technology (Part 2)
- 以 27K 成功入职字节跳动,这份《 软件测试面试笔记》让我受益终身
- Why do we say that the data service API is the standard configuration of the data midrange?
- JMeter stress testing tutorial
- R语言使用colorblinr包模拟色盲视觉、将已有的ggplot2可视化结果图像使用edit_colors函数编辑转化为色盲视觉友好的可视化结果、并自定设置色盲形式、色盲严重级别
- 谈谈redis缓存击穿透和缓存击穿的区别,以及它们所引起的雪崩效应
- golang gob实现网络数据的传输
- [today in history] June 23: Turing's birthday; The birth of the founder of the Internet; Reddit goes online
- openGauss数据库源码解析系列文章—— 密态等值查询技术详解(上)
猜你喜欢

Mathematical analysis_ Certification_ Chapter 1: the union of countable sets is countable

The company recruited a tester with five years' experience and saw the real test ceiling

ASEMI超快恢复二极管ES1J参数,ES1J封装,ES1J规格

二分查找法思路分析

2022 Jiufeng primary school (Optics Valley No. 21 primary school) student source survey

Huawei mobile phones install APK through ADB and prompt "the signature is inconsistent. The application may have been modified."

Apache基金会正式宣布Apache InLong成为顶级项目

TensorRT Paser加载onnx 推理使用

华为手机通过adb安装APK提示“签名不一致,该应用可能已被修改”

What can the accelerated implementation of digital economy bring to SMEs?
随机推荐
openGauss数据库源码解析系列文章—— 密态等值查询技术详解(上)
公司招了个五年经验的测试员,见识到了真正的测试天花板
图扑软件以轻量化建模构建智慧城市
ADC digital DGND, analog agnd mystery!
VGg download (.Net file and imagenet-vgg-verydeep-19)
网络远程访问树莓派(VNC Viewer)
Jmeter压力测试教程
Code implementation of golang binary search method
Golang writes to JSON files
TQ of R language using tidyquant package_ The transmute function calculates the daily, monthly and weekly returns of a stock. Ggplot2 uses the bar plot to visualize the monthly return data of the stoc
Thinking analysis of binary search method
Golang对JSON文件的写操作
R语言使用gt包和gtExtras包优雅地、漂亮地显示表格数据:gtExtras包的gt_sparkline函数以表格的形式可视化分组数据的线图(line plot)、包含分组类别、分组类别对应的数值
Leetcode: interview question 08.13 Stacking bin [top-down DFS + memory or bottom-up sorting + DP]
golang二分查找法代码实现
华为手机通过adb安装APK提示“签名不一致,该应用可能已被修改”
如何选择示波器?这10点一定要考虑!
你女朋友也能读懂的LAMP架构
stylegan3:alias-free generative adversarial networks
How do you choose to buy stocks? Good security?