合 Docker中使用systemctl命令时报Too many open files错误
Tags: 故障处理DockerToo many open files
自己的Docker环境
在docker的容器内使用systemctl启动服务时,报错:
1 2 3 | [root@lhrorchestrator /]# systemctl start mysql Error: Too many open files Authorization not available. Check if polkit service is running or see debug message for more information. |
这里不仅仅是mysql服务,任何服务使用systemctl启动都会报错,另外,这里绝对不是由于系统文件open-files达到最大数引起的。
查了好几天的原因,最后使用journalctl -xe命令查看日志,突然发现了一个不一样的错误:“inotify_init1() failed: Too many open files”
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | [root@lhrorchestrator /]# journalctl -xe Mar 03 12:15:53 lhrorchestrator systemd[1]: inotify_init1() failed: Too many open files Mar 03 12:15:53 lhrorchestrator systemd[1]: Unit systemd-udevd.service entered failed state. Mar 03 12:15:53 lhrorchestrator systemd[1]: systemd-udevd.service failed. Mar 03 12:15:53 lhrorchestrator systemd[1]: systemd-udevd.service has no holdoff time, scheduling restart. Mar 03 12:15:53 lhrorchestrator systemd[1]: Stopped udev Kernel Device Manager. -- Subject: Unit systemd-udevd.service has finished shutting down -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit systemd-udevd.service has finished shutting down. Mar 03 12:15:53 lhrorchestrator systemd[1]: inotify_init1() failed: Too many open files Mar 03 12:15:53 lhrorchestrator systemd[1]: start request repeated too quickly for systemd-udevd.service Mar 03 12:15:53 lhrorchestrator systemd[1]: Failed to start udev Kernel Device Manager. -- Subject: Unit systemd-udevd.service has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit systemd-udevd.service has failed. -- -- The result is failed. Mar 03 12:15:53 lhrorchestrator systemd[1]: inotify_init1() failed: Too many open files Mar 03 12:15:53 lhrorchestrator systemd[1]: inotify_init1() failed: Too many open files Mar 03 12:15:53 lhrorchestrator systemd[1]: Unit systemd-udevd.service entered failed state. Mar 03 12:15:53 lhrorchestrator systemd[1]: systemd-udevd.service failed. |
百度搜索“inotify_init1() failed: Too many open files”: