本文介绍了由于系统中打开的文件过多,Kubernetes 无法启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Kubernetes 创建一堆 pod、服务和部署,但是当我运行 kubectl describe 命令时不断遇到以下错误.

I am trying create a bunch of pods, services and deployment using Kubernetes, but keep hitting the following errors when I run the kubectl describe command.

for "POD" with RunContainerError: "runContainer: API error (500): Cannot start container bbdb58770a848733bf7130b1b230d809fcec3062b2b16748c5e4a8b12cc0533a: [8] System error: too many open files in system"

for "POD" with RunContainerError: "runContainer: API error (500): Cannot start container bbdb58770a848733bf7130b1b230d809fcec3062b2b16748c5e4a8b12cc0533a: [8] System error: too many open files in system"

我已经终止了所有 pod 并尝试重新启动机器,但这并没有解决问题.我不是Linux专家,所以我只是想知道如何找到所有打开的文件并关闭它们?

I have already terminated all pods and try restarting the machine, but it doesn't solve the issue. I am not an Linux expert, so I am just wondering how shall find all the open files and close them?

推荐答案

你可以通过运行来确认是哪个进程占用了文件描述符:

You can confirm which process is hogging file descriptors by running:

lsof | awk '{print $2}' | sort | uniq -c | sort -n

这将为您提供带有进程 pid 的打开 FD 计数的排序列表.然后你可以查找每个进程 w/

That will give you a sorted list of open FD counts with the pid of the process. Then you can look up each process w/

ps -p <pid>

如果主要的猪是 docker/kubernetes,那么我建议按照 caesarxuchao 引用的问题.

If the main hogs are docker/kubernetes, then I would recommend following along on the issue that caesarxuchao referenced.

这篇关于由于系统中打开的文件过多,Kubernetes 无法启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 22:54