...
Backup Configuration: Make a backup copy of the
opCommon.json
file before making any changes.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 in the nats_server string int the “database“ json objectCode Block language json "nats_server": "opha-dev1.opmantek.net:4222"
4. Server-Specific Configuration
4.2 Update License
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)
...
5. MongoDB Setup (Main-Primary Only)
...
Run the following command
Code Block |
---|
rs.initiate({}) |
...
4.2
...
Run the following command to set the default write concern:
Code Block |
---|
db.adminCommand({ "setDefaultRWConcern": 1, "defaultWriteConcern": { "w": 1 } }) |
5.3 Add Arbiter
Run the following command to add an arbiter to the replica set:
Code Block |
---|
rs.addArb("opha-dev2.opmantek.net:27018") |
...
Update License
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)
...
5.2 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 server ONLY:
Code Block |
---|
systemctl start nats-server |
...
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
...