MySQL Forums
Forum List  »  Replication

Re: Bin logs deletion in replicated environment
Posted by: Aftab Khan
Date: August 03, 2012 08:30AM

There is no hard or fast rule to keep binlog for N number of days. You probably know that binlogs are required for following:

1. Point-in-time recovery
http://dev.mysql.com/doc/refman/5.0/en/point-in-time-recovery.html

2. For replication
http://dev.mysql.com/doc/refman/5.0/en/binary-log.html


If binlogs take up a lot of disk space, you can remove them using:

1. expire_logs_day = N
Reduce it to 2 or 1, I have seen 100s of binary log files generated in one day, where this option is not helpful.

2. PURGE BINARY LOGS TO command to remove old binlogs
http://dev.mysql.com/doc/refman/5.0/en/purge-binary-logs.html

Note: Don't delete binary log(s) that are required by replication slave host(s). That was taken offline, for example: if you are rebuilding replication slave host or you are setting up a new replication slave host.

So you have enabled binlog on replication slave hosts too, possibly because you take regular backups on one of the slave host ? if you have enough storage you could simply archive binlogs that are required for point-in-time recovery.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Bin logs deletion in replicated environment
1116
August 03, 2012 08:30AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.