zoukankan      html  css  js  c++  java
  • linux too many open files 问题总结

    问题描述:

    kubernetes 集群使用promtail收集日志,发现一段时间有些机器日志收集不到查看promtail日志出现以下报错:

    error="filetarget.fsnotify.NewWatcher: too many open files"

    1、单个进程打开文件书过多,修改文件描述符

    vim /etc/security/limits.conf
    * soft nofile 100001
    * hard nofile 100002
    root soft nofile 100001
    root hard nofile 100002
    

    2、操作系统打开文件句柄数过多

    整个操作系统可以打开的文件句柄数是有限的,受内核参数“fs.file-max”影响。

    可以通过执行“echo 100000000 > /proc/sys/fs/file-max”命令来动态修改该值,也可以通过修改"/etc/sysctl.conf"文件来永久修改该值

    3.修改inotify

    [root@dell730-fm-100-2 ~]# sysctl fs.inotify.max_user_instances
    fs.inotify.max_user_instances = 128
    [root@dell730-fm-100-2 ~]# sysctl fs.inotify.max_user_instances=1024
    fs.inotify.max_user_instances = 1024
    [root@dell730-fm-100-2 ~]#
    

      

  • 相关阅读:
    hadoop编程问题
    poj2760:数字三角形
    poj1201:Intervals
    差分约束
    poj1033:Defragment
    poj1089:Intervals
    poj2251:Dungeon Master
    天天向上的力量 III
    整数逆位运算
    星号三角形 I
  • 原文地址:https://www.cnblogs.com/xuliang666/p/14250523.html
Copyright © 2011-2022 走看看