一个伪linux粉丝的blog

  1. 首页
  2. unix/linux
  3. 正文

"too many open files" from kubectl logs

3月 25, 2020 2312点热度 2人点赞 0条评论

昨天在查看k8s集群机器上的某个pod日志的时候发现最后一行提示failed to create fsnotify watcher: too many open files

虽然不影响我查看日志,但是这样的提示总归影响体验,想着解决。

翻到一篇中文介绍 Kubernetes - 专治疑难杂症

这是因为系统默认的fs.inotify.max_user_instances=128太小,需要重新设置此值:

  • 重新设置此值:

sudo sysctl fs.inotify.max_user_instances=8192

2020-07-30更新

几个月后发现,重启后,那个值消失了,还是在配置文件里面改吧,1行命名解决。
echo fs.inotify.max_user_instances=8192| tee -a /etc/sysctl.conf && sudo sysctl -p

类似报错Registration of the raw container factory failed: inotify_init: too many open files,也可以做类似修改。

 

改完查看日志,依然报错,并无效果,中途还查看了ulimit -a的几个其他限制,默认值都很大。

最后翻到  https://bugzilla.redhat.com/show_bug.cgi?id=1605153

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
on master
# sysctl -a | grep fs.inotify.max_user_
fs.inotify.max_user_instances = 128
fs.inotify.max_user_watches = 65536
 
on node:
# sysctl -a | grep fs.inotify.max_user_
fs.inotify.max_user_instances = 128
fs.inotify.max_user_watches = 65536
 
看的这段才想起查看所查日志的所在节点并没有修改。
kubectl get po -n default -o wide
 
NAME                                READY     STATUS    RESTARTS   AGE       IP               NODE
myapp-nginx-7655b75998-x8vqf        1/1       Running   2          15d       172.28.106.215   vps1-s1
openldap-6f64b56c6c-5l8ks           1/1       Running   1          132d      172.28.106.235   vps1-s1
phpldapadmin-5655bcf9b5-454sk       1/1       Running   1          132d      172.28.106.237   vps1-s1
postgres-postgres-d7b5449c9-cxdhs   1/1       Running   0          68d       172.28.235.65    vps1-m1
rabbitmq-rabbitmq-65f8d79bf-zdwrp   1/1       Running   2          67d       172.28.106.210   vps1-s1
redis-redis-5c8b847b8f-tpv4d        1/1       Running   0          6d        172.28.106.218   vps1-s1
 
找到想查pod所在节点,然后登录查看并修改即可。

相关文章:

  1. iWatch monitor ftp site file created and send mail
  2. docker-upgrade
  3. download files from qiniu
  4. plowshare -- command-line application to download files for file-sharing websites
标签: kubectl logs
最后更新:7月 30, 2020

wanjie

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

取消回复

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据。

归档
分类
  • network / 322篇
  • Uncategorized / 114篇
  • unix/linux / 110篇
  • 业界资讯 / 38篇
  • 公司杂事 / 11篇
  • 数码影像 / 12篇
  • 美剧 / 3篇
  • 美图共赏 / 20篇
  • 英语学习 / 3篇
标签聚合
Linux dreamhost Google Voice 邮件归档 刷机 jira 泰国 unveiled today 职责 wget gitlab iMac dreamhost空间 天翼live 黑莓8700 网站运营 nexus kernel debian d90 ldap Google google-chrome VPS 虚拟主机 Ubuntu Android Nginx k8s docker

COPYRIGHT © 2008-2022 wanjie.info. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang