LAMs and High Availability
High Availability (HA) systems aim to minimize downtime and protect against data loss and maintain performance. They use component redundancy to ensure there is no single point of failure.
In LAM High Availability architecture there are two clusters, each with an instance of the LAM. For a HA Polling pair LAM 1 and LAM 2 run in an active/passive mode; if the active LAM fails, a manual failover is initiated to the passive LAM, which sends data to the message bus. For a HA Receiving pair, the LAMs run in active/active mode.
See Install LAMs (Moogsoft Onprem) for more information on HA LAM components.
Consider the following cluster:
Cluster | Status |
---|---|
--instance AWS1 --cluster SURBITON | active |
--instance AWS2 --cluster KINGSTON | passive |
Creating the HA configuration and switching the LAM has two steps:
LAM instance: copy and create an instance of the LAM in each of the two clusters and edit their respective configuration files.
Automatic failover: automatically initiate a failover of the LAM in case a failure occurs in the active LAM.
The following examples use the AWS LAM to demonstrate the configuration process. To configure HA for another LAM, follow the same procedure using the LAM and corresponding .conf file of your choice instead.
LAM Instance
To create an instance of the LAM in each of the two clusters:
Copy the following files:
File to copy
Result
$MOOGSOFT_HOME/config/aws_lam.conf
$MOOGSOFT_HOME/config/aws_lam1.conf
$MOOGSOFT_HOME/config/aws_lam2.conf
/etc/init.d/awslamd
*If this file is not in the init.d directory, look in
$MOOGSOFT_HOME/etc/service-wrappers
/etc/init.d/awslamd1
Perform the following steps in the
awslamd1
configuration file:In the CONFIGURATION section, enter the path of aws_lam1.conf, for example
$MOOGSOFT_HOME/config/aws_lam1.conf
.In the SERVICE NAME field, enter the service name e.g.
awslamd1
.
Copy the
awslamd.conf
file:File to copy
Result
/etc/init.d/awslamd.conf
*If this file is not in the init.d directory, look here:
/usr/share/moogsoft/etc/service-wrappers
/etc/init.d/awslamd2.conf
Perform the following steps in the
awslamd2
file:Enter the path of
aws_lam2.conf
, for example$MOOGSOFT_HOME/config/aws_lam2.conf
.Enter the service name e.g. awslamd2 in the SERVICE NAME field.
Edit the following parameters in
aws_lam1.conf
file:Enter login and proxy details (if used) of the AWS server.
Edit the HA section with the following:
ha: { cluster: "SURBITON", group: "aws_lam", instance: "aws", duplicate_source: false, accept_conn_when_passive: true }
Edit the following parameters in
aws_lam2.conf
.Enter the same configuration as given in
aws_lam1.conf
Edit the
ha
section as follows:ha: { cluster: "KINGSTON", group: "aws_lam", instance: "aws", duplicate_source: false, accept_conn_when_passive: true }
Start both services:
service awslamd1 start service awslamd2 start
Configurable Fields
The fields in the ha
section of the LAM's configuration files are as follows:
Field | Description |
---|---|
| The name of the cluster. This supersedes anything set in |
| The name of the process group. This defaults to the LAM process name if no value is specified, for example, |
| The name of the AWS LAM instance. |
| If set to |
| If set to |
Automatic Failover
Automatic failover enables the passive LAM to automatically take over from the active LAM if it fails.
To set up automatic failover:
In
$MOOGSOFT_HOME/config/system.conf
, locate themooms
section and ensure themessage_persistence
property is set totrue
. This configures MooMs to persist important messages and data is replicated between two nodes in the process group, enabling the continuous processing of events.On LAM 1 and LAM 2, edit the
$MOOGSOFT_HOME/config/system.conf
file and set theautomatic_failover
property totrue
:# Allow a passive process to automatically become active if # no other active processes are detected in the same process group "automatic_failover" : true,
Restart the polling LAMs to finish enabling automatic failover.
Manual Failover
If you do not set up automatic failover, if the active LAM fails you must manually change over to the passive instance in another cluster. Use the following command to do so:
$MOOGSOFT_HOME/bin/ha_cntl -a KINGSTON.aws_lam
This changes the AWS LAM process group from the SURBITON cluster over to the KINGSTON cluster's process group, which will now publish incoming events to the message bus.
See HA Control Utility Command Reference for a list of all HA-related commands.