Accelerating log rotation

Accelerate log rotation by modifying the Ceph log rotation file.

Before you begin

  • A running IBM Storage Ceph cluster.
  • Root-level access to the node.

About this task

Increasing debugging level for Ceph components might generate a huge amount of data. If you have almost full disks, you can accelerate log rotation by modifying the Ceph log rotation file at /etc/logrotate.d/ceph-<fsid>. The Cron job scheduler uses this file to schedule log rotation.

Procedure

  1. Add the size setting after the rotation frequency to the log rotation file.
    rotate 7
     weekly
     size SIZE
     compress
     sharedscripts
    The following is an example to rotate a log file when it reaches 500 MB.
    rotate 7
     weekly
     size 500 MB
     compress
     sharedscripts
     size 500M
    Note: The SIZE value can be expressed as 500 MB or 500M.
  2. Open the crontab editor.
    For example,
    [root@mon ~]# crontab -e
  3. Add an entry to check the /etc/logrotate.d/ceph-<fsid> file.
    The following example shows how to instruct Cron to check the /etc/logrotate.d/ceph-<fsid> file every 30 minutes.
    30 * * * * /usr/sbin/logrotate /etc/logrotate.d/ceph-d3bb5396-c404-11ee-9e65-002590fc2a2e >/dev/null 2>&1