CloudWeaver



Feb
25
removing mysql-bin log files

One of the main part of Laboratoires Phoenix sentinel network is the Zabbix monitoring system.

In direct correlation with this fact is that the main concern inside this sentinel network is the database footprint of MySQL. I do not mean the ’size-in-memory’, since I do have quite enough ram on those systems. And I’m not doing that much caching since data change very, very often. What I mean is the size of the database & binaries log-files on disk.

To make the story short: I always move /var/lib/mysql on a separate partition to be certain a db surge would not bring down / compromise other server functions. Seem like I forgot (on one of the system) that Debian standard location for the mysql-bin log-files was in /var/log/mysql.

Since those are independent servers (not multi-master / replicated MySQL system), here is the magic sequence to remove unused mysql-bin files.

# vi /etc/mysql/my.cnf
[modify bin-log number/space usage]
# ls -la /var/log/mysq/
# mysql -uroot -p
[enter password]
# purge binary logs to ‘mysql-bin.000321′;
[where mysql-bin.000321 is one of the last / up to the point you want too keep].

There you go.

tagged with : , , , , , , , | permalink

Leave a Reply

© 2010 CloudWeaver | Theme by DemusDesign, Theme Lab, and Best Linux Web Hosting | Powered by WordPress