1. Atlanta Asterisk Users Group – ATLAUG
2010 Asterisk Install Fest and Conference
High availability and Fail over solutions
DJ Belieny
2. 2010 Asterisk Install Fest and Conference
High Availability / Fail Over Solutions
Common Single Point of Failure (SPoF)
Tools of the trade (Monit, Heartbeat and DRBD)
3. 2010 Asterisk Install Fest and Conference
High Availability / Fail Over Solutions
Common Single Point of Failure (SPoF)
Inbound/Outbound Trunks
Network Topology
Hardware
Software
4. 2010 Asterisk Install Fest and Conference
High Availability / Fail Over Solutions
Inbound/Outbound Trunking SPoF
Single provider
In server TDM Hardware
Single Codec support
5. 2010 Asterisk Install Fest and Conference
High Availability / Fail Over Solutions
Networking SPoF
Switching fabric
Bandwidth
IP Routing
Cables & Interfaces
6. 2010 Asterisk Install Fest and Conference
High Availability / Fail Over Solutions
Hardware SPoF
Anything starting with “Single”
Hard Drives
Cables & Interfaces
Any other moving parts
7. 2010 Asterisk Install Fest and Conference
High Availability / Fail Over Solutions
Software SPoF
Data Storage / Database
Process Handling
System Configuration
Applications
8. 2010 Asterisk Install Fest and Conference
High Availability / Fail Over Solutions
Tools of the Trade - Networking
Interface Bonding
HSRP
BGP/OSPF
IP Virtualization
9. 2010 Asterisk Install Fest and Conference
High Availability / Fail Over Solutions
Tools of the Trade - Hardware
RAID Ready servers (Mirroring)
Redundant Components
Redfone or similar for PRI HA
10. 2010 Asterisk Install Fest and Conference
High Availability / Fail Over Solutions
Tools of the Trade - Software
Heartbeat
Monit (Process Handling)
DRBD (Data replication*)
DNS
11. 2010 Asterisk Install Fest and Conference
High Availability / Fail Over Solutions
Tools of the Trade - Heartbeat
Simple yet solid clustering tool part
of the Linux HA project.
Provides Cluster monitoring and
resource control across multiple nodes
Basic setup can be achieved by editing
just 3 files ha.cf haresources authkeys
12. 2010 Asterisk Install Fest and Conference
High Availability / Fail Over Solutions
Tools of the Trade – Heartbeat
Sample ha.cf
logfacility local0
keepalive 2
deadtime 15
warntime 10
initdead 60
bcast bond0.110
node ast1
node ast2
13. 2010 Asterisk Install Fest and Conference
High Availability / Fail Over Solutions
Tools of the Trade – Heartbeat
Sample haresources
ast1 IPaddr::192.168.11.100/24/bond0.10
ast1 Ipaddr::10.1.10.100/24/bond0.110
ast1 drbddisk::sharedBD
Filesystem::/dev/drbd0::/var/sharedBD::ext3
ast1 monit
14. 2010 Asterisk Install Fest and Conference
High Availability / Fail Over Solutions
Tools of the Trade – Heartbeat
Sample authkeys
auth3
3 md5 mySecretCode
15. 2010 Asterisk Install Fest and Conference
High Availability / Fail Over Solutions
Tools of the Trade - Monit
Very simple and effective tool to monitor
processes and more in a Linux system
Provides email alerts, logging, service
monitoring and handling (start/stop)
Basic setup can be achieved by editing
just 2 files /etc/default/monit /etc/monit/monitrc
16. 2010 Asterisk Install Fest and Conference
High Availability / Fail Over Solutions
Tools of the Trade – Monit
Sample default/monit
startup=1
CHECK_INTERVALS=30
17. 2010 Asterisk Install Fest and Conference
High Availability / Fail Over Solutions
Tools of the Trade – Monit
Sample monitrc
set daemon 30
set logfile /var/log/monit.log
set mailserver localhost
set eventqueue basedir /var/monit slots 100
set mailformat { from: monit@opensourcemind.net }
set alert devteam@opensourcemind.net
set httpd port 2812 and
use address localhost
allow admin:monit
check process asterisk with pidfile /var/run/asterisk.pid
start program = "/usr/sbin/asterisk"
stop program = "/usr/bin/pkill asterisk"
18. 2010 Asterisk Install Fest and Conference
High Availability / Fail Over Solutions
Tools of the Trade – Monit
One of the great extra abilities of Monit
Is to be able to monitor if Asterisk is
up and running using SIP communication
on top of process monitoring
19. 2010 Asterisk Install Fest and Conference
High Availability / Fail Over Solutions
Tools of the Trade - DRBD
Reliable and robust block device device
mirrored over a dedicated network
Basic setup can be achieved by editing
just 1 file drbd.conf
20. 2010 Asterisk Install Fest and Conference
High Availability / Fail Over Solutions
Tools of the Trade – DRBD
on ast1 {
device /dev/drbd0;
disk /dev/sdb;
address 10.1.1.1:7788;
metadisk internal;
}
21. 2010 Asterisk Install Fest and Conference
High Availability / Fail Over Solutions
Tools of the Trade – DRBD
*Diagram downloaded from the DRBD website
22. 2010 Asterisk Install Fest and Conference
High Availability / Fail Over Solutions
Important things to remember when
using these tools for Asterisk HA
DRBD is great but adds some latency so
large beware of large recordings in number
and duration.
You can achieve redundancy using text files
bases Asterisk configuration as well as using
Asterisk Realtime Engine, just remember to
store your data under DRBD
23. 2010 Asterisk Install Fest and Conference
High Availability / Fail Over Solutions
Resources and Contact Information
The Linux-HA Guide
http://www.linux-ha.org/doc/
Linux Clustering Information Center
http://www.squidoo.com/linux-clustering
Monit Docs
http://mmonit.com/monit/documentation/monit.html
DRBD Manual
http://www.drbd.org/docs/about/
My email address
djbelieny@opensourcemind.net
And of course the ATLAUG List :)