Versions Compared

Key

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

...

  • 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 recieves receives update from the database if there is any. This change stream data is pushed onto the message bus.

...

IMPORTANT: All the servers should be setup with the following

a. Pollers and mirrors discovered by the Main - Primary

b. Server names set

c. Mongo MongoDB 6 installed

In this setup guide we are using example server/host names so you will have to use the names that you have set for your own configuration.

Main-Primary Server We will be using the below example host names throughout this guide.

You would replace with your own where applicable.

Main Primary: opha-dev1.opmantek.net

Poller1 Server: opha-dev2.opmantek.net

Mirror1 Server: opha-dev3.opmantek.net

Run the installation commands on each server as needed.

...

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:

  2. Remove or comment out the cluster section

    Code Block
    languagejson
    server_name: "opha-dev1.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 
    } 
    #cluster { 
    #  name: "C1" 
    #  host: "opha-dev1.opmantek.net"  #The current host 
    #  # the current server 
    #  listen: "0.0.0.0:6222" 
    #  routes: [ 
    #    # secondary primary
    #    "nats://opha-dev6.opmantek.net:6222" 
    #    # server with the arbiter 
    #    "nats://opha-dev2.opmantek.net:6222" 
    #    # other servers 
    #  ] 
    #}

...

  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 Main Primary FQDN and port to be utilized in the nats_server string int the “database“ json objectattribute, you can find this in the database section.

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

    IMPORTANT

    Delete the following line

  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:

...

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

Run Then run the following command

Code Block
rs.initiate()

...

Start the NATS service on the Main - Primary server ONLY:

Code Block
systemctl start nats-server

...

After configuration changes have been made, restart the services on all the servers 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
systemctl restart nmis9d opchartsd opeventsd omkd ophad

6. Update License

To obtain a license please contact firstwave sales FirstWave Sales.

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

  1. opHA-MB for NMIS & opCharts (This license is required for messagebus Message Bus to run), nmis .

    1. NMIS and opCharts data are synced from all poller/mirrors to the

    main-primary using MessageBus
    1. Main Primary using Message Bus. In replication mode, If the

    main-primary
    1. Main Primary were to go down the secondary primary will retain the

    nmis
    1. NMIS and opCharts data.

      image-20241108-050221.pngImage Modified
  2. opHA-MB for opEvents (This license is an add-on for opEvents).

    1. With this add-on opEvents will use

    MessageBus
    1. Message Bus to sync opEvents data from each poller/mirror to the

    main-primary
    1. Main Primary and in replication mode opEvents data is synced to the secondary

    -primary
    1. Primary. In replication mode, If the

    main-primary
    1. Main Primary were to go down the secondary primary will retain the opEvents data.

      image-20241107-234837.pngImage Modified

7. Restart

...

opHA service on the

...

Main Primary

Code Block
systemctl restart ophad

8. Start the Poller and Mirrors

Execute the following command on the poller and mirror servers.

...