My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
Logrotate  
Details about mysql_logrotate.sh script
Updated Dec 12, 2012 by ilmar.kerm

Introduction

The package includes script to automatically rotate and expire MySQL logfiles for all managed instances. It depends on the standard linux logrotate package (included in RHEL/OEL distributions).

Details

This script is expected to run on all cluster nodes at the same time from crontab. The script requires no parameters.

  1. Try to acquire a cluster-wide lock, the purpose of this is to ensure, that only one node will do the actual file rotation while other nodes just wait for it to complete.
  2. If lock was acquired, the script will look into all managed instance log directories and will write a linux logrotate configuration file dynamically and execute logrotate using generated configuration file.
  3. If lock was not acquired, then wait until the lock is released by another node and then continue with flushing.
  4. And finally, after log files have been rotated, all nodes will execute mysqladmin flush-logs on all managed instances.
Powered by Google Project Hosting