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 184.108.40.206 – Master MySQL server + Asterisk server
- Server 2 – IP Address 220.127.116.11 – Slave MySQL server + Asterisk server
- Server 3 – IP Address 18.104.22.168 – 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