当前位置:网站首页>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
边栏推荐
- Short video platform development, click the input box to automatically pop up the soft keyboard
- Safe and comfortable, a new generation of Qijun carefully interprets the love of the old father
- ABAP essays - program optimization notes
- R language ggplot2 visualizes horizontal boxplot with coord_flip, and adds jittered data points to display the distribution
- 数字经济加速落地,能为中小企业带来什么?
- 网络远程访问树莓派(VNC Viewer)
- Amadis发布OLA支付处理标准
- 2022九峰小学(光谷第二十一小学)生源摸底
- Google Play Academy 组队 PK 赛,火热进行中!
- 数学分析_证明_第1章:可数个可数集之并为可数集
猜你喜欢

Asemi ultrafast recovery diode es1j parameters, es1j package, es1j specification

Matlab: how to know from some data which data are added to get a known number

Solution: in the verification phase, the first batch does not report errors, and the second batch reports CUDA exceeded errors

Tupu digital twin 3D wind farm, offshore wind power of smart wind power
![Leetcode: question d'entrevue 08.13. Empiler la boîte [DFS en haut + mémoire ou tri en bas + DP]](/img/22/220e802da7543c2b14b7057e4458b7.png)
Leetcode: question d'entrevue 08.13. Empiler la boîte [DFS en haut + mémoire ou tri en bas + DP]

【解决】npm WARN config global `--global`, `--local` are deprecated. Use `--location=global`

leetcode:面试题 08.13. 堆箱子【自顶而下的dfs + memory or 自底而上的排序 + dp】

leetcode:面試題 08.13. 堆箱子【自頂而下的dfs + memory or 自底而上的排序 + dp】

IFLYTEK neuroimaging disease prediction program!
![Leetcode: interview question 08.13 Stacking bin [top-down DFS + memory or bottom-up sorting + DP]](/img/22/220e802da7543c2b14b7057e4458b7.png)
Leetcode: interview question 08.13 Stacking bin [top-down DFS + memory or bottom-up sorting + DP]
随机推荐
Pytorch: saving and exporting models
三分钟学会如何找回mysql密码
Coatnet: marrying revolution and attention for all data sizes
JS common error reporting and exception capture
leetcode:30. Concatenate substrings of all words [counter matching + pruning]
golang gob实现网络数据的传输
ASEMI超快恢复二极管ES1J参数,ES1J封装,ES1J规格
公司招了个五年经验的测试员,见识到了真正的测试天花板
[today in history] June 23: Turing's birthday; The birth of the founder of the Internet; Reddit goes online
stylegan3:alias-free generative adversarial networks
如何选择示波器?这10点一定要考虑!
Tupu digital twin 3D wind farm, offshore wind power of smart wind power
2022九峰小学(光谷第二十一小学)生源摸底
golang冒泡排序代码实现
openGauss数据库源码解析系列文章—— 密态等值查询技术详解(上)
Stick to five things to get you out of your confusion
Can the asemi fast recovery diodes RS1M, us1m and US1G be replaced with each other
2022 Jiufeng primary school (Optics Valley No. 21 primary school) student source survey
A tour of grpc:01 - Basic Theory
R language uses timeroc package to calculate the multi time AUC value of survival data in the case of no competition, uses Cox model, adds covariates, and visualizes the multi time ROC curve of surviv