On 3/2/19 1:35 PM, Shawn Rappaport wrote:
> I'm running Bacula 9.06 on CentOS 7.5 with MariaDB version 5.5.56-2. The 
> Bacula-web interface shows the DB is 69.10GB in size. However, the MySQL 
> files on my server are consuming 442GB of disk space, which is starting to 
> fill up the disk on my Director server. I see 374 mysql-bin files which are 
> almost all 1.1GB in size. I also see an ibdata1 file which is 73GB.
> 
> Do I need to perform some sort of maintenance on the DB to get things under 
> control? Sorry for my ignorance but I'm not very familiar with MySQL.


Those mysql-bin files are binary logs, MySQL's record of what changes it
applied to the database when.  MySQL automatically rotates the binary
log and starts a new one every 1GB (by default).

There's two issues here:

1.  You should never have binary logging turned on without ALSO turning
on automatic log expiration.  The configuration command is
expire_logs_days.  Add it to your MySQL configuration file and set it to
an integer number of days.  You almost certainly don't need it set
higher than three days.  The configuration file won't take effect until
you next restart MySQL; you can set it immediately by logging into MySQL
as the superuser and executing this command:

SET GLOBAL expire_logs_days = 1;

(or however many days you decide you need)

If you then issue this command as well:

FLUSH LOGS;

then MySQL will cleanly prune all of the old log files.  Otherwise, it
will prune them the next time it does a binary log rotation.


2.  *Unless* you're replicating to another server or want to be able to
do point-in-time recovery, you don't need binary logging enabled
*anyway*.  If you want to turn binary logging off:

* stop MySQL;
* edit the configuration file and remove or comment out the log_bin
directive;
* delete all of the mysql_bin* files;
* restart MySQL.

MariaDB 5.5.56 still defaults to /etc/my.cnf as the default MySQL
configuration file.  It's probably pretty minimal, and most of the
statements in it probably either reiterate compiled-in defaults or are
possibly actively harmful.


Now, your ibdata1 file.  That is the InnoDB global tablespace which
contains all of your global data.  If it's 73GB, it's because you're not
using innodb_file_per_table and it contains ALL of your data.

An InnoDB tablespace is like a filesystem.  You can grow it easily, but
there's no simple way to shrink it.  If you want to switch to using
innodb_file_per_table, which is recommended on all recent MySQL
branches, you need to dump your data, re-initialize MySQL, and reload it.

MariaDB or MySQL 5.5 is getting pretty long in the tooth.  You might
want to consider updating to a newer branch.


-- 
  Phil Stracchino
  Babylon Communications
  ph...@caerllewys.net
  p...@co.ordinate.org
  Landline: +1.603.293.8485
  Mobile:   +1.603.998.6958


_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to