My bad, Dirk, sorry.  I missed that you were asking about relay-bin
files, thought you were asking about bin files.

These relay-bin files are on the master server?  This doc:
http://dev.mysql.com/doc/refman/5.0/en/slave-logs.html
makes it sound like they should only exist on the slave servers.  Also
makes it sound like they should be cleaned up automagically after a
while.

The master isn't or wasn't a slave to another server?

I wonder if a FLUSH LOGS command would help things out.  See URL above - it says
There is no explicit mechanism for deleting relay logs because the SQL
thread takes care of doing so. However, FLUSH LOGS rotates relay logs,
which influences when the SQL thread deletes them.

Dan

On 6/28/06, Dirk Bremer <[EMAIL PROTECTED]> wrote:
Dan,

Thanks for your tips, but I still have an issue. Note the following:

mysql> PURGE MASTER LOGS BEFORE DATE_SUB( NOW( ), INTERVAL 31 DAY);
Query OK, 0 rows affected (0.01 sec)

mysql> PURGE MASTER LOGS BEFORE DATE_SUB( NOW( ), INTERVAL 10 DAY);
Query OK, 0 rows affected (0.01 sec)

These command did not purge any of these logs. These logs range in
creation-date from 12/30/2005 through today.

Note this:

mysql> show master logs;
+------------------+
| Log_name         |
+------------------+
| mysql_bin.000344 |
| mysql_bin.000345 |
| mysql_bin.000346 |
+------------------+
3 rows in set (0.00 sec)

There are relay-bin files that correspond in the 6-digit number to the
mysql-bin logs above.

I was under the impression that the PURGE MASTER command would delete
the mysql-bin files, not the replay-bin files. I was looking at the
manual earlier and could not find a reference to deleting the relay-bin
files. Thankfully, the relay-bin files are small in size, but I would
still like to prune them.

Thoughts?

Dirk Bremer - Senior Systems Engineer - ESS/AMS - NISC Lake St. Louis MO
- USA Central Time Zone
636-755-2652 fax 636-755-2503

[EMAIL PROTECTED]
www.nisc.coop

> -----Original Message-----
> From: Dan Buettner [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, June 28, 2006 15:23
> To: Dirk Bremer
> Cc: mysql@lists.mysql.com
> Subject: Re: Relay-bin logs
>
> Those do indeed have something to do with replication - they're a
> record of all data manipulation commands (inserts, updates, deletes,
> table creates and alters, etc).  The slaves basically read the
> commands from those files in order to replicate what the master has
> done.
>
> You can purge them fairly easily.  The one gotcha is that you will
> want to keep the most recent files around so that in case one or more
> of your slaves fall behind, you're not purging the logs out from
> underneath it.
>
> See
> http://dev.mysql.com/doc/refman/5.0/en/purge-master-logs.html
>
> A nice command (taken from an example on that page) that gives you a
> moving window of binary log info is something like:
> PURGE MASTER LOGS BEFORE DATE_SUB( NOW( ), INTERVAL 31 DAY);
>
> In my opinion running this command as a cron job or scheduled task is
> a great solution in most situations, better than purging to a specific
> file or purging them manually whenever you remember to (which is
> usually about 5 minutes after you run out of disk space).
>
> Dan
>
>
>
> On 6/28/06, Dirk Bremer <[EMAIL PROTECTED]> wrote:
> > I'm using MySQL 4.1 and the master runs on a Windows 2000
> server. This
> > master replicates to several slaves.
> >
> > While browsing the data directory on the master, there are a lot of
> > binary log files that are named:
> >
> > MasterName-relay-bin.999999 (where MasterName is the server-name and
> > 999999 is a six-digit number)
> >
> > I have about 350 of these files and they all appear to be
> held open by
> > the mater, i.e. they cannot be deleted from Windows. I
> assume that these
> > files have something to do with replication.
> >
> > How can I purge these files to a more manageable number?
> >
> > Dirk Bremer - Senior Systems Engineer - ESS/AMS - NISC Lake
> St. Louis MO
> > - USA Central Time Zone
> > 636-755-2652 fax 636-755-2503
> >
> > [EMAIL PROTECTED]
> > www.nisc.coop
> >
> > --
> > MySQL General Mailing List
> > For list archives: http://lists.mysql.com/mysql
> > To unsubscribe:
> http://lists.mysql.com/[EMAIL PROTECTED]
> >
> >
>


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to