防止 Jenkins 节点耗尽磁盘空间
我有四个独立的管道,它们都在同一节点上运行。最近,我收到了类似这样的错误:
Disk space is too low. Only 0.315GB left on /var/jenkins.
我已经重新配置了管道以删除旧日志并在 7 天后进行构建。除此之外,是否有任何插件或 shell 命令我可以在构建后运行以保持磁盘空间可用?
I have four separate pipelines that all run on the same node. Recently, I've been getting errors that look like this:
Disk space is too low. Only 0.315GB left on /var/jenkins.
I've already reconfigured the pipelines to get rid of old logs and builds after 7 days. Aside from this, are there any plugins or shell commands I can run post-build to keep my disk space free?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是可以通过多种方式修复/监控的问题之一。
如果您愿意,可以设置类似 datadog 或 nagios 监视您的系统并在某些内容开始填满您的
/var/jenkins
时向您发出警报。您还可以设置一个 cron 来检查并在某些内容开始填满时向您发送电子邮件。
但是,如果您想弄清楚为什么它已满,则可能是您的
/var
分区太小,但在不查看磁盘分区布局的情况下,很难给出答案更好的答案。This is one of those problems that can be fixed/monitoried in multiple ways.
If you're willing to you can set up something like datadog or nagios to monitor your system and alert you when something is starting to fill up your
/var/jenkins
.You can also set up a cron that checks and emails you when something is starting to fill up.
But if you'd like to figure why it's filling up, it's possible that your
/var
partition is too small, but without seeing your disk partition layout it's hard to give a better answer.我在 jenkins 节点解决方案之一中遇到了同样的问题
:ssh 到您的从站并执行此 df -h,它将显示磁盘信息和 /tmp 中的可用空间,并通过
sudo mount -o remount /tmp增加 tmp 大小
I Have faced same issue with the one of the jenkins node
solution: Ssh to your slave and do this df -h, it will show disk info, and available space in /tmp and increase tmp size by
sudo mount -o remount /tmp