今天vcenter告警日志剩余空间不足,打开系统看了一下:
日志空间已经使用百分之百了
首先清理了一下tga 文件
使用SSH登录到vCenter Server Appliance。
导航到根目录cd /
搜索任何旧的日志包: find -iname * .tgz
导航到相关目录并删除旧的日志包:
rm * .tgz
重新启动所有vCenter Server服务
然后发现效果并不理想,只清理了300多兆的空间,只好继续在找办法清理空间。最后找到如下办法:
要临时解决 vCenter Server Appliance 中的/storage/log目录已满问题,请在log4j.properties文件中增加最大备份大小和最大备份索引。
Cause
此问题是由于/storage/log目录中的 SSO 日志文件增长导致的。在日志轮换期间,旧日志文件未经压缩,从而导致 /storage/log 中存储了多个大型文件。
Resolution
这是会影响 vCenter Server Appliance 6.0 的已知问题。
目前,尚无解决方案。
要临时解决此问题,请在 log4j.properties 文件中增加最大备份大小和最大备份索引。
以 root 用户身份登录到 vCenter Server Appliance 控制台。
运行以下命令以启用对 Bash shell 的访问:
shell.set --enabled true
键入shell,然后按 Enter。cd /usr/lib/vmware-sso/vmware-sts/webapps/sts/WEB-INF/classes/
cplog4j.propertieslog4j.properties.bak
使用文本编辑器打开log4j.properties文件。service vmware-stsd restart
导航到:rm localhost_access_log.*
rm vmware-identity-sts.*
rm vmware-identity-sts-perf.*
Additional Information
经过上述操作后,果然清出一部分空间
您还会遇到以下症状:在 /storage/log/vmware/sso 目录中运行du -sh命令时,可以看到已使用几个 GB 的空间。
在 vSphere Web Client 中,您将看到以下警示:
日志 /storage/log 的可用存储已达到警告阈值 - 小于 30 % 可用空间 (Available storage for logs /storage/log reached warning threshold - less then 30 % available space)
日志 /storage/log 的可用存储已达到关键阈值 - 小于 15 % 可用空间 (Available storage for logs/storage/log reached critical threshold - less then 15 % available space)
关于阈值怎么修改还没搞明白,搞明白后继续上教程。
VMware知识库:vCenter Server Appliance 6.0 中的 /storage/log 目录已满 (2143565)