[asterisk-dev] CDR on multiple database servers - getting rid of duplicates

Gaston Draque gaston.draque at gmail.com
Tue Aug 20 09:21:54 CDT 2013


Hi Leandro,
   First, Im not sure why the solution was layed out like that, but as a
rule of thumb, a single unique event should not be writen to 2 different
mysql servers when they are running on a master-master replication scheme.
This in itself is wrong and should be avoided.
   If for topology reasons, you have 2 groups of Asterisk servers, each one
writing to one specific mysql server then to do so, use the mysql increment
and offset parameters to prevent collisions.
   On a second note, I believe the asterisk-users list is better suited for
this kind of questions and you will get more answers.

Gaston//



On Tue, Aug 20, 2013 at 7:24 AM, Leandro Dardini <ldardini at gmail.com> wrote:

> Hello,
> I am running a cluster of asterisk servers and each one is writing the CDR
> to 2 mysql servers configured with multi master replication using the
> cdr_adaptive_odbc driver.
>
> cdr_adaptive_odbc.conf has the following configuration:
>
> [cdr1]
> connection=asteriskcdrdb1
> table=cdrraw
>
> [cdr2]
> connection=asteriskcdrdb2
> table=cdrraw
>
> As you can imagine, if both mysql servers are available, every CDR is
> written twice.
>
> To get rid of duplicates, every query against the cdr database need to use
> the "DISTINCT" using an intermediate table and that is slow, really slow.
>
> Nothing is better if I use a view with the SELECT DISTINCT, it is slower
> than before.
>
> The only solution I see to add an option in cdr_adaptive_odbc.conf and if
> set to change the INSERT in the cdr_adaptive_odbc.conf adding a "ON
> DUPLICATE KEY UPDATE..." or better a "INSERT IGNORE"
>
> What do you think about it?
>
> Leandro
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev
>



-- 
{
  "fullName" : "Gaston Draque"
  "email"    : "gaston.draque at gmail.com"
  "twitter"  : "@gdraque"
  "google+"  : "gplus.to/gdraque"
  "linkedIn" : "http://www.linkedin.com/in/draque"
  "tags"     : ["uc communications","telecom integrator","voip","software
development"]
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130820/1fcb11f2/attachment.htm>


More information about the asterisk-dev mailing list