...
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
Currently there are 2 available licenses and messagebus will not run without a license.
opHA-MB for NMIS & opCharts (This license is required for messagebus to run)
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
Connect to MongoDB using the mongosh
command and configure the replica set:
...
Code Block |
---|
rs.initiate({ _id: "rs1", version: 1, members: [ { _id: 0, host : "opha-dev1.opmantek.net:27017" }, { _id: 1, host : "opha-dev6.opmantek.net:27017" } ] }) |
...
6.2 Set Default Write Concern
Run the following command to set the default write concern:
Code Block |
---|
db.adminCommand({ "setDefaultRWConcern": 1, "defaultWriteConcern": { "w": 1 } }) |
...
6.3 Add Arbiter
Run the following command to add an arbiter to the 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:
Code Block |
---|
sudo systemctl restart mongod |
...
...
7. Starting Services
...
7.1 Start NATS
Start the NATS service on the Main-Primary, Secondary Primary, and Arbiter servers ONLY:
Code Block |
---|
systemctl start nats-server |
...
7.2 Restart mongod on Pollers and Mirrors only
After configuration changes, restart mongod on all Mirrors and Pollers servers ONLY :
Code Block |
---|
systemctl restart mongod |
...
7.3 Restart services on all servers
After configuration changes, restart the services on all the servers :
Code Block |
---|
systemctl restart nmis9d opchartsd opeventsd omkd ophad |
...
7.4 Start the Poller and Mirrors
Execute the following command on the poller and mirror servers.
Code Block |
---|
cd /usr/local/omk/bin ./ophad cmd producer start |
...
8. Final Steps
Accept EULAs: Make sure when you login to each server to confirm that all End User License Agreements (EULAs) are accepted.
8. Switching Main and Secondary Primary Servers
To switch from Main-Primary to Secondary Primary, follow these steps:
Connect to MongoDB:
Code Block mongosh --username opUserRW --password op42flow42 admin
Update member priorities:
cfg = rs.conf() cfg.members[0].priority = 0.6 cfg.members[1].priority = 0.5 rs.reconfig(cfg)Code Block
...