您的位置:首页 > 其它

How to Refine the Log Retention Settings in XenServer

2012-10-23 16:14 423 查看

How to Refine the Log Retention Settings in XenServer

Document ID: CTX131619 / Created On: 2012-3-10 / Updated On: 2012-3-10

Average Rating:


(2 ratings)

View products this document applies to

Summary

This article describes how to refine the logging configuration on XenServer.

Requirements

You must have console access to a XenServer either through the local console, XenCenter, or SSH.

Background

If the log size of the host is increasing to a larger size, you can consider refining the logging configuration on XenServer by completing the following procedure.

Remember that this procedure must be completed on each individual XenServer host. These configuration changes do not propagate between hosts in a pool.

Procedure

To verify the used space on log directory, run the following command on the XenServer host console:

# du –h /var/log

Following is a sample output of the preceding command:



In the preceding sample, the sum of all the logs in /var/log is 84MB. If the size of this directory approaches 1GB, the log configuration requires refining.

The following three methods are recommended for restraining the increase of the size of the log files in this directory.

Run logrotate hourly instead of daily. Run the following command from the XenServer host console:

# mv /etc/cron.daily/logrotate.conf /etc/cron.hourly/logrotate.conf


Advanced cron scheduling can be used in some scenarios.

Compress old logs. To compress the old log files use the VI to edit the logrotate.conf file. In the /etc/logrotate.conf file, remove the comment from the following line:

#compress


Retain fewer historical logs.

By default XenServer retains 20 historical logs. This can be reduced by changing the numeric value in the following line:

rotate 20

Note that any logs above this threshold value are not be managed by the logroate file and will need to be removed manually.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐