Re: Mysql binary logging and replication.

2006-11-09 Thread Christoph Schug
On Thu, Nov 09, 2006, Bill Campbell wrote:

> In particular the rc.mysql run control %daily processing is written to
> handle normal ascii logs, and I’m not sure how to deal with the binary logs
> which seem to be incremented twice by the ‘‘rc mysql restart’’ 
> command in
> %daily processing.

Hi Bill,

there shouldn't be a restart action any longer on a daily (better:
nightly :) basis. Recently I commited a change agains CURRENT which
avoids restarting the server. I think, Ralf merged it to STABLE
already.

While plain text logs can be rotated via shtool (better: can be removed
after keeping X generations) automatically, this cannot be done when
it comes to binary logs without taking the risk of any data loss. You
have to make sure that all replication slaves already have fetched the
binary log you want to get rid of before you can safely remove it.
Needless to say that this cannot be done by the package easily since to
whole process depends very much on your local setup and configuration.
"Easily" in this case doesn't mean impossible but up to now noone has
implemented it ;)

For now, it might be easier if you write a little script suited to your
local needs which checks all the slaves periodically and purges the
older binary logs on master, if all slaves have picked them up already.
See the MySQL docs for details [1] (I hope this hasn't changed since I
read about the stuff last time).

[1] http://dev.mysql.com/doc/refman/5.0/en/purge-master-logs.html

-cs
__
The OpenPKG Projectwww.openpkg.org
Developer Communication List   openpkg-dev@openpkg.org


Mysql binary logging and replication.

2006-11-09 Thread Bill Campbell
Has anybody done anything with mysql replication which seems to require
binary logging?

I'm just trying to figure out mysql replication, and am not too
familiar with the ins and outs of mysql logging.

In particular the rc.mysql run control %daily processing is written to
handle normal ascii logs, and I’m not sure how to deal with the binary logs
which seem to be incremented twice by the ‘‘rc mysql restart’’ command 
in
%daily processing.  There is a 4 byte binary log file created each night
just before the binary log index file, and another binary log file which
has the real updates.

It seems to me that it would be more appropriate to have mysql
reload rather than stop and start when doing binary logging.

Bill
--
INTERNET:   [EMAIL PROTECTED]  Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/  PO Box 820; 6641 E. Mercer Way
FAX:(206) 232-9186  Mercer Island, WA 98040-0820; (206) 236-1676

``the purpose of government is to reign in the rights of the people''
-Bill Clinton during an interview on MTV in 1993
__
The OpenPKG Projectwww.openpkg.org
Developer Communication List   openpkg-dev@openpkg.org