zoukankan      html  css  js  c++  java
  • K8s NodeHasFDPressure

    0x00 事件

    收到 k8s 其中一台 node 发出的告警,信息如下:

    Node condition FDPressure is now: True, reason: NodeHasFDPressure
    
    [hostname:cn-hangzhou.172.16.2.17,kind:Node,lastday:1,message:Node condition FDPressure is now: True, 
    reason: NodeHasFDPressure,name:cn-hangzhou.172.16.2.17,namespace:null,today:1]
    

    在守护进程中 node-problem-detector-daemonset 的 workload 中,查找到关键日志:

    I1106 14:50:31.518065       1 plugin.go:111] Add check result {Rule:0xc00003a380 ExitStatus:1 
    Message:current fd usage is 850859 and max is 1048576} for rule &{Type:permanent Condition:FDPressure Reason:NodeHasFDPressure 
    Path:/config/plugin/check_fd.sh Args:[] TimeoutString:<nil> Timeout:<nil>}
    

    日志解释到:「当前的文件描述符已使用 850859,而最大是 1048576」。

    而因为超出了 FD 最大的限制数的 80 %,所以才会收到该告警。

    0x01 处理

    先查了 /etc/security/limits.conf 文件,发现限制并不是日志中显示的 1048576,再看 /proc/sys/fs/file-max

    [root@iZwt0Z jumpuser]# cat /proc/sys/fs/file-max
    1048576
    

    看来需要修改系统的总限制,也就是 /proc/sys/fs/file-max

    [root@iZwt0Z jumpuser]# echo 6553560 > /proc/sys/fs/file-max
    [root@iZwt0Z jumpuser]# cat /proc/sys/fs/file-max
    6553560
    [root@iZwt0Z jumpuser]# vim /etc/sysctl.conf
    ……
    fs.file-max = 6553560
    

    处理后,日志显示恢复正常:

    I1106 14:58:31.206048       1 custom_plugin_monitor.go:138] New status generated: &{Source:fd-custom-plugin-monitor Events:
    [{Severity:info Timestamp:2020-11-06 14:58:31.205994278 +0800 CST m=+508.031832028 Reason:NodeHasNoFDPressure 
    Message:Node condition FDPressure is now: False, reason: NodeHasNoFDPressure}] 
    Conditions:[{Type:FDPressure Status:False Transition:2020-11-06 14:58:31.205994278 +0800 CST m=+508.031832028 Reason:NodeHasNoFDPressure 
    Message:node has no fd pressure}]}
    

    参考:Linux可打开最大文件数

  • 相关阅读:
    如何使用vs2008单元测试416a3648
    限制TextBox的长度
    DataGrid双击事件
    结构与类
    DataGrid删除对话框 & 限制编辑模试TextBox长度
    安逸...
    新来的,请多关照~!
    asp.net中使用JMail发邮件
    silverlight3datagrid中的数据导出到excel
    sl3中的DataGrid中的数据导出到Excel中 使用csv格式 解决中文是乱码的问题
  • 原文地址:https://www.cnblogs.com/nnylee/p/13953419.html
Copyright © 2011-2022 走看看