Automate the startup of Galera Cluster on 2 nodes after a reboot
In the post Galera Cluster for MySQL we saw how to install, configure and start a Galera cluster with MySQL on 2 nodes, and we also focused on the importance of the node startup procedure. A critical condition could occur as each node looks for a primary to connect to on startup. In case of restarting the single server, there would be no problems activating the automatic start of mysqld via systemctl, but in case of a complete restart of the infrastructure on one of the servers it is mandatory to proceed with bootstrapping the cluster.
Galera Cluster for MySQL, 2 nodes setup
Galera Cluster is a synchronous multi-master cluster for MySQL/MariaDB. It allows you to create an active-active multi-master topology with synchronous data replication, supporting read and write operations on all nodes in the cluster.
Redis in HA with Sentinel
Redis (REmote DIctionary Server) is a high-performance, open-source, non-relational in-memory database that can be used as a store of key-value data structures. It can obviously be used as a single instance, therefore installed on a single server, or configured in High Reliability. There are two ways to have a HA-type Redis architecture, activate a Redis Cluster having at least 6 nodes available (3 Master + 3 Slave), or use Sentinel having 3 nodes available with Sentinel installed on, in addition to the Master and Slave nodes of Redis.
Kamailio Balancing capability
The “dispatcher” module provides support for several traffic balancing and dispatching algorithms.
In this tutorial we will see how to configure Kamailio to balance traffic to different destinations based on their availability, illustrating round-robin modes and priorities. Kamailio is able to monitor the status of the target endpoints through the use of SIP OPTIONS or other messages like INFO.
Configuring Kamailio with rtpengine to relay RTP traffic behind NAT
In a test environment, so in a fully controlled environment I would say, usually all the elements involved in a VoIP call are on the same subnet and this means that the RTP media streams flow directly between the caller and the called party. However, this never happens in the real world, where instead the scenario is much more complex and both SIP signaling messages and media streams must traverse firewalls and NATs.
In general we can think of a scenario like the one shown in the following figure, where the caller is outside our infrastructure and the called party is on a local network behind a SIP Proxy, which is behind a firewall.
Kamailio installation and configuration
Kamailio is an Open Source SIP Server released under the GPLv2+ license, able of handling thousands of call setups per second, fully supporting the SIP protocol defined in IETF RFC 3261, including the various annexes and addons. The main use of Kamailio is as a SIP Proxy for routing SIP messages, but several additional features are also supported and described on the official website at the link https://www.kamailio.org/w/. On the official documentation you will find the details of the various modules supported by the system, here instead we will briefly see how to install and configure Kamailio for handling SIP calls.
RTPengine install - CentOS/RHEL 7
Complete guide for installing RTPengine on a CentOS 7 or RHEL 7 server
Using sngrep
There are several tools to monitor network traffic, such as tcpdump on Linux or wireshark on Windows, here instead we are going to install sngrep, a very useful tool for analyzing SIP traffic. The main feature of sngrep is the ability to graphically display the complete flow of a SIP call even over an SSH session.
SIPp for SIP traffic simulation
SIPp is a free Open Source SIP traffic generator. It allows to design call scenarios via xml file and then execute them. A call scenario described in an xml file is basically a SIP call flow, in which it is possible to define in detail the various SIP messages to be simulated, starting from a simple scenario with REGISTER - 200OK sequence, to more complex scenarios with re-INTIVE, REFER, etc…
It is a very light tool in terms of resource allocation, so it’s great for creating stress test scenarios with thousands of calls, but at the same time it can be used to create single call tests. SIPp can perform call scenarios working both as UAS (SIP Server) and as UAC (SIP Client), and also includes the possibility of managing media via RTP echo and RTP pcap play. In addition, it includes reporting functions needed to monitor the progress of the current scenario.
In short, it is an extremely configurable and easy to use tool in all those cases in which we have to go and test SIP traffic applications.
RHEL7 Failover Cluster
In this tutorial we will see how to create a cluster between two Red Hat Enterprise Linux (RHEL) 7 virtual machines. I installed them on ESXi platform, with 2 vPCU and 2 GB of RAM each, but this is a detail. Three IP addresses are required, one for each RHEL server and one as a virtual IP for the cluster. Virtual machines need to communicate with each other.