Writing CDR’s To Two Database Servers

Home » Asterisk Users » Writing CDR’s To Two Database Servers
Asterisk Users 8 Comments

All;

I know that there are probably several solutions to this problem, but what I am trying to do is provide some redundancy for my customers CDR data. I know that doing simple backups of MySQL is probably the easiest way to go, but I’m thinking that there may be some benefit to simultaneously writing the CDR data to multiple servers at once. However, I’m drawing a blank on this one. Has anyone else done this before? Any insight at all would be greatly appreciated.

Thanks Much;

John V.

8 thoughts on - Writing CDR’s To Two Database Servers

  • You could – if you really wanted – use two different cdr_ modules to write to, for example, a MySQL and a PostgreSQL database simultaneously.

    Having said that, and given nearly every modern DBMS has its own replication built-in, you’d be far better off using that. There are good instructions online for MySQL and PostgreSQL – and no doubt for other DBMSs as well.

    Kind regards,

    Chris

  • 1. Agreed – use replication.

    2. If you want an HA (High Availability, not dependent on a single Master DB
    server replicating to a slave) solution, consider setting up Master-Master replication, with an LVS (Linux Virtual Server) HA machine in front of the two, so that writes can go to either server using only a single IP address configured in Asterisk.

    Then, if one fails, you can still write to (and read from) the other, repair the failed one, and restore replication.

    Antony


    Atheism is a non-prophet-making organisation.

    Please reply to the list;
    please *don’t* CC me.

  • Beside the already mentioned solutions, you could take a look at a multi-master setup like a Galera Mysql cluster. Works perfectly for short queries without locks like CDRs.

  • I appreciate all the feedback, and replication seems to be a logical solution, but I was initially thinking about how to implement a solution within Asterisk to write the CDR’s to two databases. Is that possible? Now I’m just curious. Thanks Much;
    John V.

    —–Original Message—–
    From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] 1. Agreed – use replication.

    2. If you want an HA (High Availability, not dependent on a single Master DB server replicating to a slave) solution, consider setting up Master-Master replication, with an LVS (Linux Virtual Server) HA machine in front of the two, so that writes can go to either server using only a single IP address configured in Asterisk.

    Then, if one fails, you can still write to (and read from) the other, repair the failed one, and restore replication.

    Antony


    Atheism is a non-prophet-making organisation.

    Please reply to the list;
    please *don’t* CC me.

  • Sorry, maybe it’s been mentioned. An AGI at call termination to write to the other database?