Moogsoft Docs

HA Configuration

High Availability (HA) systems aim to minimize downtime, protect against data loss and maintain performance by using component redundancy to ensure there is no single point of failure.

In LAM High Availability architecture we have two clusters with each cluster an instance of the LAM. One LAM is active and the other is passive. If the active LAM fails, a manual failover is initiated to the passive LAM, which sends data to the message bus.

In the example below:

Cluster

Status

--instance AWS1 --cluster SURBITON

active

--instance AWS2 --cluster KINGSTON

passive

Creating the HA configuration and switching the LAM in HA 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 file.

  2. Failover: manually initiate a failover of the LAM in case of failure in the active LAM.

LAM Instance

Create an instance of the LAM in each of the two clusters:

  1. Set the following property in system.conf:

    Property

    Location

    Description

    message_persistence: true

    Config folder

    system.conf, mooms section

    The message_persistence configuration controls whether the message bus will persist important messages or not and when set to true will ensure that two moog_farmds in the same process group share the relevant queues or servers, this allows failover in moog_farmd to ensure continuous processing of events. Defaults to false.

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

    /usr/share/moogsoft/etc/service-wrappers

    /etc/init.d/awslamd1

    Perform the following steps in the awslamd1 file:

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

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

    3. Replace the daemon lines with these:

      daemon --pidfile=$PID_FILE $MOOG_WRAPPER --home=$PROCESS_HOME --process=$PROCESS_NAME --config=$CONFIG_FILE--logfile=$LOG_FILE --pidfile=$PID_FILE --loglevel=$LOG_LEVEL --instance AWS1 --cluster SURBITON
      
      daemon --pidfile=$PID_FILE --user=$PROCESS_OWNER $MOOG_WRAPPER --home=$PROCESS_HOME --process=$PROCESS_NAME --config=$CONFIG_FILE --logfile=$LOG_FILE --pidfile=$PID_FILE --loglevel=$LOG_LEVEL --instance AWS1 --cluster SURBITON
      
  3. 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. Replace the daemon lines with these:

      daemon --pidfile=$PID_FILE $MOOG_WRAPPER --home=$PROCESS_HOME --process=$PROCESS_NAME --config=$CONFIG_FILE--logfile=$LOG_FILE --pidfile=$PID_FILE --loglevel=$LOG_LEVEL --instance AWS2 -- cluster KINGSTON
      
      daemon --pidfile=$PID_FILE --user=$PROCESS_OWNER $MOOG_WRAPPER --home=$PROCESS_HOME --process=$PROCESS_NAME --config=$CONFIG_FILE --logfile=$LOG_FILE --pidfile=$PID_FILE --loglevel=$LOG_LEVEL --instance AWS2 --cluster KINGSTON
      
  4. 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 like this:

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

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

    2. Edit the HA section like this:

      ha:
      {
         cluster: "KINGSTON",
         group: "aws_lam",
         instance: "aws",          
         duplicate_source: false, 
         default_leader: true,
         only_leader_active: true,
         accept_conn_when_passive: true
      }
  6. Start both services:

    service awslamd1 start
    service awslamd2 start
    
Configurable Fields

Field

Description

cluster

The name of the cluster. This supersedes anything set in system.conf (can also be overwritten by the command line).

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, it allows duplicate events from the same source. Defaults to false.

default_leader

A Boolean, indicating if the LAM is the leader within its process group. The default value is true if not specified

only_leader_active

A Boolean that changes the type of process group from a leader only group to a process group where more than one process can be active.

accept_conn_when_passive

A Boolean instructing the LAM what to do in passive mode. If true (or not set), the LAM accepts incoming connections but discards any events received. If false, the LAM does not accept incoming connections

Failover
$MOOGSOFT_HOME/bin/ha_cntl -a KINGSTON.aws_lam

The AWS LAM process group from the SURBITON Cluster is changed over to the KINGSTON Cluster.

Initially, SURBITON LAM cluster was active and KINGSTON LAM cluster was passive. After executing the command, KINGSTON LAM cluster is active. The active LAM now publishes the events to the message bus.