Moogsoft Docs

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 without Caching LAM for more information on HA LAM components.Install without Caching LAM

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:

  1. LAM instance: copy and create an instance of the LAM in each of the two clusters and edit their respective configuration files.

  2. 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:

  1. 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:

    1. In the CONFIGURATION section, enter the path of aws_lam1.conf, for example $MOOGSOFT_HOME/config/aws_lam1.conf.

    2. In the SERVICE NAME field, enter the service name e.g. awslamd1.

  2. 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:

    1. Enter the path of aws_lam2.conf, for example $MOOGSOFT_HOME/config/aws_lam2.conf.

    2. Enter the service name e.g. awslamd2 in the SERVICE NAME field.

  3. Edit the following parameters in aws_lam1.conf file:

    1. Enter login and proxy details (if used) of the AWS server.

    2. Edit the HA section with the following:

      ha:
      {
         cluster: "SURBITON",          
         group: "aws_lam",           
         instance: "aws",          
         duplicate_source: false,                   
         accept_conn_when_passive: true
      }
      
  4. Edit the following parameters in aws_lam2.conf.

    1. Enter the same configuration as given in aws_lam1.conf

    2. Edit the ha section as follows:

      ha:
      {
         cluster: "KINGSTON",
         group: "aws_lam",
         instance: "aws",          
         duplicate_source: false, 
         accept_conn_when_passive: true
      }
  5. 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

cluster

The name of the cluster. This supersedes anything set in system.conf.

group

The name of the process group. This defaults to the LAM process name if no value is specified, for example, aws_lam.

instance

The name of the AWS LAM instance.

duplicate_source

If set to true, drops duplicate events from the same source. Defaults to false.

accept_conn_when_passive

If set to true, the passive LAM accepts incoming connections but discards any events received. Defaults to false.

Automatic Failover

Automatic failover enables the passive LAM to automatically take over from the active LAM if it fails.

To set up automatic failover:

  1. In $MOOGSOFT_HOME/config/system.conf, locate the mooms section and ensure the message_persistence property is set to true. This configures MooMs to persist important messages and data is replicated between two nodes in the process group, enabling the continuous processing of events.

  2. On LAM 1 and LAM 2, edit the $MOOGSOFT_HOME/config/system.conf file and set the automatic_failover property to true:

    # Allow a passive process to automatically become active if
    # no other active processes are detected in the same process group
    "automatic_failover" : true,
  3. 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.