Tag Archives: replicate

A2Billing – MySQL Master / Slave and Asterisk load balancing – Part 1

Below are instructions for setting up A2Billing with a MySQL Master/Slave database. In this configuration the A2Billing database is replicated to a standby/slave server. Whilst it would require a manual failover to the standy server, the configuration is pretty simple and easy to manage.

It also walks through setting up A2Billing load balancing across multiple Asterisk servers. This relies on Asterisk/A2Billing being configured to use RealTime, which it is by default on the SysAdminMan template.

All 3 servers used were built using the SysAdminMan VPS template. You will need to change IP addresses throughout the instructions to match your server IPs. The test servers used are –

  • Server 1 – IP Address 1.1.1.1 – Master MySQL server + Asterisk server
  • Server 2 – IP Address 2.2.2.2 – Slave MySQL server + Asterisk server
  • Server 3 – IP Address 3.3.3.3 – Asterisk server

While the instructions are quite long the outline of what is happening is –

  • Open ports in the firewall
  • Configure server 1 as the Master MySQL database
  • Export the mya2billing database from the Master server and copy it to the slave
  • Configure server 2 as the Slave MySQL database
  • Import the database from the Master server and start the replication
  • On all 3 servers configure Asterisk and A2Billing to use the Master database

Continue reading