To provide high availability to protect from a single server meltdown, crash, or to have minimum downtime maintenance e.g. (1-4 seconds of lost audio, with no dropped calls) , use this configuration.
NOTE: This is not a cluster, each single machine must be able to handle the entire load itself.
Other than the system IP configuration file (with static internal / external IPs), and the heartbeat monitoring IP, the entire system should be identical, especially all of FreeSWITCH's files. That means you can upgrade FreeSWITCH on the backup, do a little testing, move over the traffic, and then rsync the entire FreeSWITCH directory to the other server.
- 2 servers (or VPS, preferably different physical machines)
- a 3rd, Floating IP
- IP Failover
- Heartbeat to monitor the other server is responding
- Pacemaker to monitor and move resources (floating IP, starting/restarting FreeSWITCH profiles, e.g. triggering "sofia recover"
- FreeSWITCH monitoring OCF script
- OR uCARP
- ODBC for the database for anything to be saved, with replication. For core, voicemail, and all profiles and mods. I'm using MySQL in master-master mode.
/etc/init.d/freeswitch Add this to the list.. start, stop..
/etc/init.d/FSSofia - the "start" part might be a bad idea...
My current "crm configure edit"
- Please set up ODBC in the core
- Also, set up the DSN in limit.conf.xml if you plan on using limits
In each profile that you want to be able to failover, you need to tell FreeSWITCH to track all channel states in the database...
And tell it which database to use that will be replicated.
Also, you'll have to specify the SIP, RTP bind IP etc to be the floating IP, rather than the machine's auto-detected IP.
You can leave the profile running binded to the floating IP that's not yet there. However, your OS may not allow it until you do:
Specify the ODBC-DSN to store the voicemail preferences and messages:
And, make sure that either
- Both servers have the same domain name in their configuration (will be if you rsync them, but the default may be the machine's IP)
- OR change the default voicemail storage location.
NOTE: There needs to be a mechanism to sync the voicemail greetings and messages. An rsync --update from both sides will keep it current, but will keep deleted voicemail files. A one-way rsync from the master with --delete is better, perhaps triggered with a hangup hook from the dialplan after transferring to voicemail, OR some sort of cron set up in pacemaker. Remember, this needs to be asynchronous-able, so that you can push updates to a server that was down and comes back up.
If you just write the log, that can be easily rsync'd without worry of deletions.
If you use FusionPBX, please make sure you are using the web submission, so that the CDRs get written once directly into the archive folder, rather than getting written to the archive folder and THEN moved. That would make things confusing because we would need to keep track of the master to keep the xml logs in sync.