...
| Table of Contents | ||
|---|---|---|
|
...
Introduction
opHA-MB 5.0 X introduces the concept of a Primary & multiple Poller servers and a Message Bus:
...
Upgrade to opHA-MB 5.1.0 can be done from infrastructure
running New to opHA/opHA-MB
Running opHA 4.X
New to opHA
1. Upgrade to opHA-5.1.0 with no opHA
...
| Code Block | ||
|---|---|---|
| ||
sudo sh ./opHA-Linux-x86_64-5.0.0.run |
1.4 Install Message Bus Software
The Message Bus software (NATS) has to be installed and configured.
For this scenario, we do not need a MongoDB Arbiter, so use -y to answer yes to the two questions.
cd /usr/local/omk/installsudo sh ./install_message_bus.sh -y
...
| Code Block |
|---|
sudo systemctl start nats-server |
5.
...
After configuration changes, restart mongod on all Poller and Mirror servers ONLY:
| Code Block |
|---|
sudo systemctl restart mongod |
5.3 Restart FirstWave daemons on all servers
...
Poller1 Server: opha-poller1.opmantek.net
1.1.
...
Download the opHA 5 software onto each server.
1.3 Install Software
Run the installation commands on each server in the opHA cluster.
All the following setup commands in this setup should be run as the root user
| Code Block | ||
|---|---|---|
| ||
sudo sh ./<executable> |
e.g
| Code Block | ||
|---|---|---|
| ||
sudo sh ./opHA-Linux-x86_64-5.0.0.run |
1.4 Install Message Bus Software
The Message Bus software (NATS) has to be installed and configured.
For this scenario, we do not need a MongoDB Arbiter, so use -y to answer yes to the two questions.
cd /usr/local/omk/installsudo sh ./install_message_bus.sh -y
2. NATS Setup
This configuration should be applied to the Main Primary server ONLY.
Edit Configuration: Update the
/etc/nats-server.conffile with the following settings:Change the server_name to the name of your Main Primary server.
Remove or comment out the
clustersection, so that this remains:
...
| language | json |
|---|
...
1 Editing the Role of the instance in opCommon.json
The default value of opha_role in opCommon.json is Standalone
| Code Block |
|---|
shankarn@opha-dev7:~$ grep opha_role /usr/local/omk/conf/opCommon.json
"opha_role" : "Standalone", |
Edit /usr/local/omk/conf/opCommon.json to change in to one of
“Main Primary”
“Primary”
“Poller”
“Mirror”
1.1.1 Installing opHA-MB 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.
...
1.2 Download Software
Download the opHA 5 software onto each server.
1.3 Install Software
Run the installation commands on each server in the opHA cluster.
All the following setup commands in this setup should be run as the root user
| Code Block | ||
|---|---|---|
| ||
sudo sh ./<executable> |
e.g
| Code Block | ||
|---|---|---|
| ||
sudo sh ./opHA-Linux-x86_64-5.0.0.run |
1.4 Install Message Bus Software
The Message Bus software (NATS) has to be installed and configured.
For this scenario, we do not need a MongoDB Arbiter, so use -y to answer yes to the two questions.
2. NATS Setup
This configuration should be applied to the Main Primary server ONLY.
Edit Configuration: Update the
/etc/nats-server.conffile with the following settings:Change the server_name to the name of your Main Primary server.
Remove or comment out the
clustersection, so that this remains:
| Code Block | ||
|---|---|---|
| ||
server_name: "opha-primary1.opmantek.net" #The local server http_port: 8222 listen: 4222 jetstream: enabled #tls { # cert_file: "<path>" # key_file: "<path>" # #ca_file: "<path>" # verify: true #} log_file: "/var/log/nats-server.log" accounts { $SYS { users: [ { user: "omkadminadmin", password: "op42opha42" } ]pass: "password" jetstream: enabled } } jetstream { store_dir: "/opt/nats/storage" max_memory_store: 1028M ] } max_file_storeophad: 1028M{ } |
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:
Run the following command
| Code Block |
|---|
mongosh --username opUserRW --password op42flow42 admin |
Then run the following commands, to initiate a MongoDB Replica Set for streaming database changes.
| Code Block |
|---|
rs.initiate()
exit |
Restart mongod
| Code Block |
|---|
systemctl restart mongod |
3. Common Configuration for All Servers
3.1 Update /usr/local/omk/conf/opCommon.json
Backup Configuration: Make a backup copy of the
opCommon.jsonfile before making any changes.Add NATS Server Configuration: Ensure the following configuration is included in
opCommon.jsonon 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 thedatabasesection.Code Block language json "nats_server": "opha-primary1.opmantek.net"IMPORTANT
Delete the following line from the
opCommon.jsonfile.Code Block language json "db_mongo_cluster": [],
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 Poller and 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.
...
users: [
{ user: "omkadmin", password: "op42opha42" }
]
jetstream: enabled
}
}
jetstream {
store_dir: "/opt/nats/storage"
max_memory_store: 1028M
max_file_store: 1028M
}
|
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:
Run the following command
| Code Block |
|---|
mongosh --username opUserRW --password op42flow42 admin |
Then run the following commands, to initiate a MongoDB Replica Set for streaming database changes.
| Code Block |
|---|
rs.initiate()
exit |
Restart mongod
| Code Block |
|---|
systemctl restart mongod |
3. Common Configuration for All Servers
3.1 Update /usr/local/omk/conf/opCommon.json
Backup Configuration: Make a backup copy of the
opCommon.jsonfile before making any changes.Add NATS Server Configuration: Ensure the following configuration is included in
opCommon.jsonon 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 thedatabasesection.Code Block language json "nats_server": "opha-primary1.opmantek.net"IMPORTANT
Delete the following line from the
opCommon.jsonfile.Code Block language json "db_mongo_cluster": [],
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 Poller and 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.
7. Restart opHA service on the Main Primary
...