How to Refine the Log Retention Settings in XenServer

How to Refine the Log Retention Settings in XenServer

Document ID: CTX131619   /   Created On: 2012-3-10   /   Updated On: 2012-3-10
Average Rating:5 (2 ratings)

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值