...
opHA 5 introduces the concept of a Primary & multiple Poller servers and a message bus : (with replication):
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.
With Replication and Nats if the main-primary Main Primary goes down the secondary primary will take over also if a poller goes down the mirror will take over.
...
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 | an instance of the ophad process running in 'consumer' mode (as per configuration). This will typically be running on the same server instance as the poller (or mirror) |
...
1. Software Installation
1.1 Download Software
...
IMPORTANT: All the servers should be setup with the following
a. Pollers and mirrors discovered by the Main - Primary
b. Server names set
c. Secondary Primary server setup as Primary
c. One server needs to be an Arbiter. A poller can be used for this
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 configurationWe will be using the below example host names throughout this guide.
You would replace with your own where applicable. For this example we have the required 6 servers for the setup.
IMPORTANT:
One server should be set as an Arbiter and in this example we are using Poller1 Server
Main - Primary Server: opha-dev1.opmantek.net
Poller1 Server: opha-dev2.opmantek.net [Arbiter Server]
Mirror1 Server: opha-dev3.opmantek.net
Poller2 Server: opha-dev4.opmantek.net
Mirror2 Server: opha-dev5.opmantek.net
Second - Primary: opha-dev6.opmantek.net
Run the installation commands on each server as needed.
...
Code Block | ||
---|---|---|
| ||
sh ./opHA-Linux-x86_64-5.0.0.run |
VERY IMPORTANT : During the installation of the arbiter server you must answer 'Nn' at the following prompt
...
2. NATS Setup
This configuration should be applied to the Main - Primary, Arbiter, and Secondary Primary servers ONLY.
...
Backup Configuration: Make a backup copy of the
opCommon.json
file before making any changes.Add NATS Cluster Configuration: Ensure the following configuration is included in
opCommon.json
on all servers. In the below example we have added the main-primaryMain Primary, arbiter and second-primary Secondary Primary FQDNs and port/s to be utilized in the nats_cluster array under the “database“ json objectserver attribute, you can find this in the database section.Code Block language json "nats_cluster": [ "opha-dev1.opmantek.net:4222", "opha-dev2.opmantek.net:4222", "opha-dev6.opmantek.net:4222" ]
4. Server-Specific Configuration
4.1 Update /usr/local/omk/conf/opCommon.json
for Main
...
Primary and Secondary Primary only
and Secondary Primary servers:
Code Block | ||
---|---|---|
| ||
"db_replica_set": "rs1", "db_mongo_cluster": [ "opha-dev1.opmantek.net", "opha-dev6.opmantek.net" ], "nats_num_replicas": 3, "nats_cluster": [ "opha-dev1.opmantek.net", "opha-dev2.opmantek.net", "opha-dev6.opmantek.net" ] |
5. 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.
opHA-MB for NMIS & opCharts (This license is required for messagebus Message Bus to run), nmis
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 MessageBus 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.
6. MongoDB Setup (Main
...
Primary Only)
The following steps should be performed only on the Main - Primary MongoDB instance.
6.1 Initialize MongoDB Replica Set
...
Code Block |
---|
rs.addArb("opha-dev2.opmantek.net:27018") |
6.4 Restart mongod on the Main
...
Primary and Second
...
Primary
Run the following command on the Main - Primary, Secondary Primary, and Arbiter servers ONLY:
...
Start the NATS service on the Main - Primary, Secondary Primary, and Arbiter servers ONLY:
...
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 |
...