LinHES Forums
http://forum.linhes.org/

R5E50 logs outgrowing disk (mysql-bin, .xsession-errors)
http://forum.linhes.org/viewtopic.php?f=6&t=14147
Page 1 of 1

Author:  rsay [ Sun Feb 11, 2007 10:19 pm ]
Post subject:  R5E50 logs outgrowing disk (mysql-bin, .xsession-errors)

I've had two episodes of large log files leading to crashes. When I looked at the disk, sda1 was 100% full. The two offenders were the mysql binary log files in /var/log/mysql and the .xsession-errors file hidden in the mythtv home directory. (I used "du -sh *" to track down where all the space had gone.) Is there a safe way to stop these files from running amuck? Specically, is there a way to limit their size without getting rid of them entirely.

Author:  tjc [ Mon Feb 12, 2007 9:18 pm ]
Post subject: 

The log rotation stuff should be doing that, but it may be time based rather than size based... You should be able to configure it to trigger on log size... You may also need to change the crontab to have it run hourly rather than the current daily.

See:
Code:
man logrotate

Author:  rsay [ Tue Feb 13, 2007 9:22 pm ]
Post subject: 

I'm not sure if logrotate is supposed to do anything with the mysql binary logs. my understanding is that this is supposed to act as a data backup so that you can take your backup and then play back the binary logs since the time of that backup to bring the mysql database back to the moment of the failure. It would seem counterintuitive for logrotate to destroy this data. I think it would be better to figure out how to turn off this feature. I'm sure its handy for banks and web based businesses but I'm not in need of up-to-the-minute data integrity for my tv shows. Particularly when the feature is crashing my computer and corrupting my databases.

I'll try to figure out how to get logrotate to pick up the /home/mythtv/.xsession-errors file.

Author:  tjc [ Tue Feb 13, 2007 9:31 pm ]
Post subject: 

If you mean the ib_logfile0, ib_logfile1 and ibdata1 files, there is a way to resize those too. The default seems to be only ~5-10Mb which isn't all that big.

Author:  rsay [ Tue Feb 13, 2007 9:57 pm ]
Post subject: 

I ran logrotate with the -f option so that it would run more often than once daily. It didn't touch the /var/log/mysql/mysql-bin.????? files or the /home/mythtv/.xsession-errors files.

Author:  RobTheGob [ Fri Mar 09, 2007 6:45 pm ]
Post subject: 

Sorry to bump an old post, but I was having the same issues with the mysql binary logs.

Basically, in order to clear the logs:
Code:
mysql -u root

Then in mysql:
Code:
reset MASTER;
exit

I then edited /etc/mysql/my.cnf to disable the binary logs:
Code:
#log_bin                      = /var/log/mysql/mysql-bin.log
#expire_logs_days     = 10
#max_binlog_size         = 100M

Then, restart mysql:
Code:
/etc/init.d/mysql restart

Hope it helps...

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/