Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Non-Replication Setup and Configuration Guide

...

Table of Contents
stylenone

...

Introduction

opHA-MB 5.0 introduces the concept of a Primary & multiple Poller servers and a message bus:

  • The Primary is the server that keeps the information of all the pollers and it is where we can read all the information from. The Consumer (ophad running on Primary) reads data continuously off the message bus and stores it in the database

  • The Producer (ophad running on Pollers) has a change stream setup for the collections and receives update from the database if there is any. This change stream data is pushed onto the message bus.

Here are For the terms used in this project together with their meanings.

...

Term

...

Meaning

...

Main Primary

...

server instance running opHA with role = 'primary_master'

...

Secondary Primary

...

server instance running opHA with role = 'master'. Also referred to as just 'primary'.

...

Peer

...

server instance running opHA with role = 'poller' or 'mirror'. It can optionally be of type 'streaming' which means that it is linked to an ophad instance.

...

Poller

...

server instance running opHA with role = 'poller'

...

Mirror

...

server instance running opHA with role = 'mirror'. It is paired with a poller and polls the same devices as that poller, however its data is not sync'd with primary unless the poller is offline.

...

Producer

...

an instance of the ophad process running in 'producer' mode (as per configuration). This will typically be running on the same server instances as the primary.

...

Consumer

...

, see https://docs.community.firstwave.com/wiki/spaces/opHA/pages/edit-v2/3164408853#Terminology.

1. Software Installation

1.1

...

Download the required software onto each server.

1.2 Install Software

Prerequisites

IMPORTANT: All the servers should be setup with the following

a. opHA 4 needs to be currently installed

b. Pollers and mirrors Mirrors discovered by the Main Primary

bc. Server names set

cd. MongoDB 6 installed

We will be using the below example host names throughout this guide.

You would replace with your own where applicable.

Main Primary: opha-dev1primary1.opmantek.net

Poller1 Server: opha-dev2poller1.opmantek.netMirror1 Server: opha-dev3.opmantek.net

1.2 Download Software

Download the opHA 5 software onto each server.

1.3 Install Software

Run the installation commands on each server as neededin the opHA cluster.

All the following setup commands in this setup should be run as the root user

Code Block
languagejson
sudo sh ./<executable>

e.g

Code Block
languagejson
sudo sh ./opHA-Linux-x86_64-5.0.0.run

2. NATS Setup

This configuration should be applied to the Main Primary server ONLY.

  1. Edit Configuration: Update the /etc/nats-server.conf file with the following settings:

    1. Change the server_name to the name of your Main Primary server.

    2. Remove or comment out the cluster section, so that this remains:

Code Block
languagejson
server_name: "opha-

...

primary1.opmantek.net"  #The local server  
http_port: 8222 
listen: 4222 
jetstream: enabled 
accounts { 
  $SYS { 
    users = [ 
      { user: "admin",
        pass: "password" 
      } 
    ] 
  } 
  ophad: { 
    users: [ 
        { user: "omkadmin", password: "op42opha42" } 
    ] 
    jetstream: enabled 
  } 
} 

jetstream { 
  store_dir: "/opt/nats/storage" 
  max_memory_store: 1028M 
  max_file_store: 1028M 
}

...

 

...

3. Common Configuration for All Servers

3.1 Update /usr/local/omk/conf/opCommon.json

  1. Backup Configuration: Make a backup copy of the opCommon.json file before making any changes.

  2. Add NATS Server Configuration: Ensure the following configuration is included in opCommon.json on all servers. In the below example we have added the Main Primary FQDN and port to be utilized in the nats_server attribute, you can find this in the database section.

    Code Block
    languagejson
    "nats_server": "opha-dev1primary1.opmantek.net:4222"

    IMPORTANT

    Delete the following line from the opCommon.json file.

  3. Code Block
    languagejson
    "db_mongo_cluster": [],

4. MongoDB Setup (Main Primary Only)

The following steps should be performed only on the Main Primary MongoDB instance.

4.1 Initialize MongoDB Replica Set

Connect to MongoDB using the mongosh command and configure the replica set:

Run the following command

Code Block
mongosh --username opUserRW --password op42flow42 admin

Then run the following commandcommands, to initiate a MongoDB Replica Set for streaming database changes.

Code Block
rs.initiate()
exit

Restart mongod

Code Block
systemctl restart mongod

5. Starting Services

5.1 Start NATS (on Main Primary Only)

Start the NATS service on the Main Primary server ONLY:

Code Block
sudo systemctl start nats-server

5.2 Restart mongod on Pollers and Mirrors only

After configuration changes, restart mongod on all Mirrors Poller and Pollers Mirror servers ONLY:

Code Block
sudo systemctl restart mongod

5.3 Restart

...

FirstWave daemons on all servers

After configuration changes have been made, you will need to restart the relevant FirstWave module daemons applicable to your server.

For example if you have NMIS9, opCharts, opEvents and opHA 5 installed you would execute as follows:

Code Block
sudo systemctl restart nmis9d opchartsd opeventsd omkd ophad

Note: after you restart the daemons, opHA MB will not be licensed on the Main Primary, so the ophad daemon will show as an Error:

...

Proceed to the next step.

6. Update License

Install the opHA-MB for NMIS & opCharts license on the Main Primary server only.

To obtain a license please contact FirstWave Sales.

Currently there are 2 available licenses and Message Bus will not run without a license.

  • opHA-MB for NMIS & opCharts (This license is required for Message Bus to run).

NMIS and opCharts data are synced from all poller/mirrors to the Main Primary using Message Bus. In replication mode, If the Main Primary were to go down the

...

Secondary Primary will retain the NMIS and opCharts data.

...

  • opHA-MB for opEvents (This license is an add-on for opEvents).

With this add-on opEvents will use Message Bus to sync opEvents data from each poller/mirror to the Main Primary and in replication mode opEvents data is synced to the

...

Secondary Primary. In replication mode, If the Main Primary were to go down the

...

Secondary Primary will retain the opEvents data.

...

You need to enter a License Key in the Modules → opLicensing as below on the Main Primary.

...

7. Restart opHA service on the Main Primary

Code Block
sudo systemctl restart ophad

8. Start the Poller and Mirrors

Execute the following command on the poller and mirror servers.

Code Block
cdsudo /usr/local/omk/bin
./ophad cmd producer start

9. Final Steps

  1. Accept EULAs: Make sure when you login to each server to confirm that all End User License Agreements (EULAs) are accepted.

...