bayes in MySQL with replication

Rick Cooper rcooper at dwford.com
Fri Feb 22 14:55:04 GMT 2008


 


  _____  

From: mailscanner-bounces at lists.mailscanner.info
[mailto:mailscanner-bounces at lists.mailscanner.info] On Behalf Of Jason Ede
Sent: Friday, February 22, 2008 7:00 AM
To: MailScanner discussion
Subject: OT: bayes in MySQL with replication



(sent 2ce as I think it was blocked first time due to random binary
characters)

 

I know this is way off topic, but I'm guessing others have had this and have
solved it...

 

Since our 2 mail servers are on different sites and the VPN between them
hasn't been overly reliable I've been trialling the bayes in MySQL with
Master - Master replication. (MySQL 5.0)

 

This seems to work fine for a few hours and I then get...

 

080222 10:38:07 [ERROR] Slave: Error 'Duplicate entry '<random binary>' for
key 1' on query. Default database: 'sa_bayes'. Query: 'INSERT INTO
bayes_token

                   (id, token, spam_count, ham_count, atime)

                   VALUES ('1','<random binary>','0','1','1203675610')',
Error_code: 1062

080222 10:38:07 [ERROR] Error running query, slave SQL thread aborted. Fix
the problem, and restart the slave SQL thread with "SLAVE START". We stopped
at log 'mysql-bin.000006' position 8791360

 

and SQL replication stops. Is there any way of avoiding this or of
specifying a default action in case of a clash like this?

 

Currently each mailserver connects to the local copy of the database.

 

Jason

 


[Rick Cooper] 
 
Add
 
slave-skip-errors = 1062
 
To your mysql config file under the [mysqld] section. that line says skip
duplication errors, you might even want slave-skip-errors = 1053,1062 (skip
master shutting down  and data duplication errors)
 
Look here for other replication config options that might interest you
 
http://dev.mysql.com/doc/refman/5.1/en/replication-options.html

 
 
-- 
This message has been scanned for viruses and 
dangerous content by  <http://www.mailscanner.info/> MailScanner, and is 
believed to be clean. 


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.mailscanner.info/pipermail/mailscanner/attachments/20080222/4dced07a/attachment.html


More information about the MailScanner mailing list