Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Backup Configuration: Make a backup copy of the opCommon.json file before making any changes.

  2. 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_cluster attribute, you can find this in the database section.

    Code Block
    languagejson
    "nats_cluster": [ "opha-dev1.opmantek.net", "opha-dev2.opmantek.net", "opha-dev6.opmantek.net" ]
  3. Ensure "nats_num_replicas": 3 instead of 1 in /usr/local/omk/conf/opCommon.json.

    Code Block
    "database" : {
        "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" ]
      }​

Server-Specific Configuration

...

  1. Ensure there is only one instance of “db_replica_set” and "db_mongo_cluster" in opCommon.json. If there are more than one instance of these 2 parameters there could be issues

    Code Block
    shankarn@opha-dev7:~$ grep replica /usr/local/omk/conf/opCommon.json

...

db_mongo_cluster is cluster of ‘Main Primary’ and ‘Secondary Primary’

...

breakoutModewide
breakoutWidth760
languagejson

...

  1. 
          "nats_num_replicas" : 

...

  1. 3,
    shankarn@opha-dev7:~$ grep nats_num_replicas /usr/local/omk/conf/opCommon.json
          "

...

  1. nats_num_replicas" : 3,
    

...

MongoDB Setup (Main Primary Only)

The following steps should be performed only on the Main Primary MongoDB instance.

Initialize MongoDB Replica Set

Connect to MongoDB using the mongosh command and configure the replica set:

Run the following command

Code Block
breakoutModewide
breakoutWidth760
mongosh --username opUserRW --password op42flow42 admin

Add the main-primary and secondary-primary to the below command and run it

...

breakoutModewide
breakoutWidth760

...

  1. shankarn@opha-dev7:~$


Server-Specific Configuration

Update /usr/local/omk/conf/opCommon.json for Main Primary and Secondary Primary only. For key “database” add the following information:

db_mongo_cluster is cluster of ‘Main Primary’ and ‘Secondary Primary’

Code Block
breakoutModewide
breakoutWidth760
languagejson
"database" : {
    "db_replica_set": "rs1", 
    "db_mongo_cluster": [ "opha-dev1.opmantek.net:27017", priority: 2 }, { _id: 1, host : "opha-dev6.opmantek.net:27017", priority: 1 } ] })

Set Default Write Concern

...

"opha-dev6.opmantek.net" ], 
    "nats_num_replicas": 3, 
    "nats_cluster": [ "opha-dev1.opmantek.net", "opha-dev2.opmantek.net", "opha-dev6.opmantek.net" ]
  }

MongoDB Setup (Main Primary Only)

The following steps should be performed only on the Main Primary MongoDB instance.

Initialize MongoDB Replica Set

Connect to MongoDB using the mongosh command and configure the replica set:

Run the following command

Code Block
breakoutModewide
breakoutWidth760
db.adminCommand({ "setDefaultRWConcern": 1, "defaultWriteConcern": { "w": 1 } })

Add Arbiter

...

mongosh --username opUserRW --password op42flow42 admin

Add the main-primary and secondary-primary to the below command and run it

Code Block
breakoutModewide
breakoutWidth760
rs.addArb("opha-dev2initiate({ _id: "rs1", version: 1, members: [ { _id: 0, host : "opha-dev1.opmantek.net:27018")

...

27017", priority: 2 }, { _id: 1, host : "opha-dev6.opmantek.net:27017", priority: 1 } ] })

Set Default Write Concern

Run the following command on the Main Primary, Secondary Primary, and Arbiter servers ONLY:to set the default write concern:

Code Block
breakoutModewide
breakoutWidth760
sudo systemctl restart mongod

Starting Services

Start NATS

...

db.adminCommand({ "setDefaultRWConcern": 1, "defaultWriteConcern": { "w": 1 } })

Add Arbiter

Run the following command to add an arbiter to the replica set:

Code Block
breakoutModewide
breakoutWidth760
systemctl start nats-serverrs.addArb("opha-dev2.opmantek.net:27018")

Restart mongod on

...

the Main Primary, Second Primary and Arbiter

Run the following command on the Main Primary, Secondary Primary, and Arbiter servers ONLY:

Code Block
breakoutModewide
breakoutWidth760
sudo systemctl restart mongod

Restart services on all servers

...

Starting Services

Start NATS

Start the NATS service on the 3 servers: Main Primary, Secondary Primary, and Arbiter servers ONLY

Code Block
breakoutModewide
breakoutWidth760
systemctl start nats-server

Restart mongod on Pollers and Mirrors only

After configuration changes, restart mongod on all Mirrors and Pollers servers ONLY:

Code Block
breakoutModewide
breakoutWidth760
systemctl restart mongod

Restart services on all servers

After configuration changes have been made, you will need to restart the relevant FirstWave module daemons applicable to your server.

...

  1. Backup Configuration: Make a backup copy of the opCommon.json file before making any changes.

  2. 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_cluster attribute, you can find this in the database section.

    Code Block
    languagejson

    section.

    Code Block
    languagejson
    "nats_cluster": [ "opha-dev1.opmantek.net", "opha-dev2.opmantek.net", "opha-dev6.opmantek.net" ]

  3. Ensure "nats_num_replicas": 3 instead of 1 in /usr/local/omk/conf/opCommon.json.

    Code Block
    "database" : {
        "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" ]
      }​
  4. Ensure "nats_num_replicas": 3 instead of 1 in there is only one instance of “db_replica_set” and "db_mongo_cluster" in opCommon.json. If there are more than one instance of these 2 parameters there could be issues

Code Block
breakoutModewide
breakoutWidth760
shankarn@opha-dev7:~$ grep replica /usr/local/omk/conf/opCommon.json

...


...

      "nats_num_replicas" : 3,
shankarn@opha-dev7:~$ grep nats_num_replicas /usr/local/omk/conf/opCommon.json
  

...

 

...

 

...

 

...

 "nats_num_replicas" : 3,



Server-Specific Configuration

...