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. 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
      
      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
      
  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. 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
      
      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
      
  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 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
      }
      
  4. 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
      }
  5. 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.

$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.