...
Edit Configuration: Update the
/etc/nats-server.conf
file with the following settings:Code Block language json 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 ] }
...
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 Primary, arbiter and Secondary Primary FQDNs and port/s to be utilized in the nats_server cluster 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
...
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 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.
You need to add your license to the opLicensing app as below on the main-primary and second-primary servers
6. MongoDB Setup (Main Primary Only)
...
Code Block |
---|
mongosh --username opUserRW --password op42flow42 admin |
Run the following commandAdd the main-primary and secondary-primary to the below command and run it
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" } ] }) |
...
Code Block |
---|
rs.addArb("opha-dev2.opmantek.net:27018") |
6.4 Restart mongod on the Main Primary
...
, Second Primary and Arbiter
Run the following command on the Main Primary, Secondary Primary, and Arbiter servers ONLY:
...