Moogsoft Docs

Set Up the User Interface Role for HA

The UI role includes the Nginx and Apache Tomcat components. There are also a number of Moogsoft AIOps webapps (servlets) installed and running within Tomcat, responsible for the following processes:

  • graze: Graze API

  • moogpoller: Dynamic updates to UI

  • moogsvr: Services HTTP requests

  • situation_similarity: Calculates the situation similarity and pushes to UI

  • toolrunner: Services Server Tools

HA architecture

In our distributed HA installation, the UI components are installed on servers 1, 2, 6, 7 and 8.

HA_UI.png
  • Server 1: UI 1

  • Server 2: UI 2

  • Server 6: Elasticsearch Node 1

  • Server 7: Elasticsearch Node 2

  • Server 8: Elasticsearch Node 3

  • Server 6: RabbitMQ Node 1

  • Server 7: RabbitMQ Node 2

  • Server 8: RabbitMQ Node 3

Fully distributed installation

See Distributed HA Installation for a reference diagram and steps to achieve a fully distributed installation.

Minimally distributed installation

For a minimally distributed installation follow the instructions below, replacing servers 1, 2, 6, 7 and 8 with the relevant values for your architecture.

Install UI primary
  1. Install Moogsoft AIOps components on the UI Primary server.

    On server 1 install the following Moogsoft AIOps components:

    yum -y install moogsoft-common-7.3* \
        moogsoft-integrations-ui-7.3* \
        moogsoft-ui-7.3* \
        mooogsoft-utils-7.3*
  2. On server 1 install, configure and start HA Proxy.

  3. Initialize the UI stack:

    moog_init_ui.sh -twfz <ZONE> -c <server 6 hostname>:15672 -m <server 6 hostname>:5672 -s <server 6 hostname>:9200 -n

    Note

    <server 6 hostname> is the server where the Core Primary is configured.

  4. On server 1 edit the $MOOGSOFT_HOME/config/system.conf file and set the mooms.zone and mooms.brokers properties as follows:

    "zone" : "<ZONE>",
    "brokers" : [ { "host" : "<server 6 hostname>", "port" : 5672 },
        { "host" : "<server 7 hostname>", "port" : 5672 },
        { "host" : "<server 8 hostname>", "port" : 5672 }
    ],
  5. In the same file, edit the search.nodes property as follows:

    "nodes" : [ { "host" : "<server 6 hostname>", "port" : 9200 },
        { "host" : "<server 7 hostname>", "port" : 9200 },
        { "host" : "<server 8 hostname>", "port" : 9200 }
    ]

    Note

    The brokers object must list all hostnames that form the RabbitMQ cluster and nodes must list the hostnames that form the Elasticsearch cluster.

  6. In the same file, set the ha section as follows:

    "ha": { "cluster": "PRIMARY" },
  7. Edit servlets.conf.

    On server 1, edit the $MOOGSOFT_HOME/config/servlets.conf file and uncomment the ha section at the bottom of the file. Set the content of the ha section as follows (note the leading comma):

    ,ha :
    {
        cluster: "PRIMARY",
        group: "ui1",
        instance: "primary",
        start_as_passive: false
    }
  8. On server 1, restart the Apache Tomcat service:

    systemctl restart apache-tomcat
Install UI secondary
  1. Install Moogsoft AIOps components on the UI Secondary server.

    On server 2 install the following Moogsoft AIOps components:

    yum -y install moogsoft-common-7.3* \
        moogsoft-integrations-ui-7.3* \
        moogsoft-ui-7.3* \
        mooogsoft-utils-7.3*
  2. Install and configure HA Proxy on the UI Secondary server for connection to Percona XtraDB Cluster.

    On server 2 install, configure and start HAProxy.

  3. Initialize the UI stack.

    On server 2, run the following command to initialize the UI stack:

    moog_init_ui.sh -twfz <ZONE> -c <server 7 hostname>:15672 -m <server 7 hostname>:5672 -s <server 7 hostname>:9200 -n

    Note

    <server 7 hostname> is the server where the Core Secondary is set up.

  4. Reconfigure system.conf on the UI Secondary server.

    On server 2 edit the $MOOGSOFT_HOME/config/system.conf file and set the mooms.zone and mooms.brokers properties as follows:

    "zone" : "<ZONE>",
    "brokers" : [ { "host" : "<server 7 hostname>", "port" : 5672 },
        { "host" : "<server 6 hostname>", "port" : 5672 },
        { "host" : "<server 8 hostname>", "port" : 5672 }
    ],
  5. In the same file, edit the search.nodes property as follows:

    "nodes" : [ { "host" : "<server 7 hostname>", "port" : 9200 },
        { "host" : "<server 6 hostname>", "port" : 9200 },
        { "host" : "<server 8 hostname>", "port" : 9200 }
    ]
  6. In the same file, se the ha section as follows:

    "ha": { "cluster": "SECONDARY" },
  7. Edit servlets.conf.

    On server 2, edit the $MOOGSOFT_HOME/config/servlets.conf file. Uncomment the ha section at the bottom of the file and set the content as follows (note the leading comma):

    ,ha :
    {
        cluster: "SECONDARY",
        group: "ui2",
        instance: "secondary",
        start_as_passive: false
    }
  8. On server 2, restart the Apache Tomcat service:

    systemctl restart apache-tomcat
Configure the UI load balancer

A user session needs to be served from the same UI stack, ie. they need to stay connected to the same UI server for the duration of their session, or until that UI server becomes unavailable (in which case the load balancer will redirect the user to the secondary). This is because requests are routed via moogsvr and data is received from moogpoller (web sockets).

Configure the UI load balancer with the following attributes:

  • Since both UI stacks are active you can choose to implement the round robin or least connection balancing method.

  • Route web traffic only to the Nginx behind which there is an active UI. The decision for this is based on a moogsvr servlet check via the ‘hastatus’ Tomcat endpoint. It will return a 204 if the UI stack is UP. It does not however report on the health of other roles, ie. Core (Moogfarmd, RabbitMQ and Elasticsearch clusters), Database (Percona Cluster), LAMs.

  • Sticky sessions are preferred. Traffic needs to be routed to the same backend server based on the same MOOGSESS cookie.

You can send the following example cURL command from the command line to check moogsvr servlet status:

curl -k https://server1/moogsvr/hastatus -v