Clear VCENTER log files

Copyright: https://blog.csdn.net/weixin_42226813/article/details/80757976

Today, the remaining space is insufficient vcenter alarm log, open system looked at:


Log space has been used a hundred percent

First, clean up a bit tga file

Log in to the vCenter Server Appliance using SSH.
Navigate to the root directory cd /
search for any old log package: find -iname * .tgz
navigate to the relevant directory and delete the old log package: 
 RM * .tgz

Restart all vCenter Server service


Then found that the effect is not ideal, just clean up more than 300 megabytes of space, but to continue looking for ways to clean up space. Finally, we find the following way:

To temporarily solve the vCenter Server Appliance / storage / log directory is full problem, increase the maximum backup size and the maximum backup index in the log4j.properties file.
Cause
This problem is due / storage / log directory log file growth has led to the SSO. During log rotation, the old log files are not compressed, resulting in / storage / log stored in multiple large files.
Resolution
This is a known issue affects the vCenter Server Appliance 6.0.
Currently, there is no solution.

To temporarily work around this problem, increase the maximum backup size and the maximum backup index in the log4j.properties file.
Log in to the vCenter Server Appliance console as the root user.
Run the following command to enable access to the Bash shell:

shell.set --enabled true

Type shell, and then press Enter.
Navigate to the following directory:

cd /usr/lib/vmware-sso/vmware-sts/webapps/sts/WEB-INF/classes/


Run the following command to back up log4j.properties file:

cplog4j.propertieslog4j.properties.bak


Use a text editor to open the log4j.properties file.
Found log4j.appender.LOGFILE.MaxFileSize log4j.appender.LOGFILE.MaxBackupIndex parameters and in the following entries:
log4j.appender.LOGFILE.File} = $ {catalina.base /logs/vmware-identity-sts.log
respectively parameter value 50 and changed to 5:
example:
log4j.appender.LOGFILE.MaxFileSize = 50MB
log4j.appender.LOGFILE.MaxBackupIndex = 5
found in the following entries log4j.appender.PERFLOG.MaxBackupIndex parameters:
log4j.appender.PERFLOG.File = $ { catalina.base} /logs/vmware-identity-sts-perf.log
change the value of the parameter is 3.
For example:
log4j.appender.PERFLOG.MaxBackupIndex = 3
Run the following command to restart the STS service:

service vmware-stsd restart


Navigate to:
cd / Storage / log / VMware / sso /
remove old localhost_access_log by running the following command, vmware-identity-sts and vmware-identity-sts-perf log file:

rm localhost_access_log.*
rm vmware-identity-sts.*
rm vmware-identity-sts-perf.*

Additional Information



After the above operation, part of the space indeed cleared


You will also experience the following symptoms:

When you run the command du -sh / storage / log / vmware / sso directory, you can see a few GB of used space.
In the vSphere Web Client, you will see the following warning:

Log / storage / log usable storage warning threshold has been reached - less than 30% of available space (Available storage for logs / storage / log reached warning threshold - less then 30% available space)

Log / storage / log has available storage reaches a critical threshold - less than 15% of available space (Available storage for logs / storage / log reached critical threshold - less then 15% available space)

About how to modify the threshold do not understand, I do understand that continued after the tutorial.


VMware Knowledge Base: vCenter Server Appliance 6.0 in / storage / log directory is full (2143565)

Guess you like

Origin blog.csdn.net/weixin_42226813/article/details/80757976