From: Xavier Beaudouin <[EMAIL PROTECTED]> - 2007-08-06 14:31 > > The approach that should be taken is: > > > > 1) Set up master -> slave replication > > 2) Change policyd so that all READS happen from the slave(s) > > and WRITES only go to the master.
I agree to the idee that replication should not happen in policyd, but in MySQL, cause MySQL already supports replication and redundancy. And it works nearly like a charm. But here is the problem : policyd doesn't use an AUTO_INCREMENT id in its primary keys (in "triplet" table mostly), so if two mail servers receive the same mail in the same time (between the time at which policyd checks in the entry already exists and the time at which it inserts a new one), the first server will insert the new entry, and the second server won't be able to insert it (primary key constraint violation) so the replication will stop. > > I personnaly like this since I have already replicated system like > that with severals slaves... and a loadbalancer have lb read slaves. I set up 3 mail servers (MX) with policyd and MySQL multi-master chain replication (each node is slave of the previous one and master of the next one). I think a solution would be to insert "IF EXIST" in DELETE and UPDATE queries, and "IF NOT EXIST" in INSERT queries of policyd (greylist.c source file), so that the same query could be executed two times without stopping replication. What do you think of this solution ? Could it be done upstream, to make policyd a perfect greylisting daemon for mail server clusters ? I can provide technical details and documentation on my setup if necessary. Sincerely, Olivier > > > Such a solution not only makes your environment cleaner and > > problems easier to diagnose, but it makes Policyd more robust. > > :) Good I think :) > > /Xavier > > -- > Xavier Beaudouin - http://oav.net/ -- Olivier Smedts Cemagref de Lyon ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ policyd-users mailing list policyd-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/policyd-users