Versions Compared

Key

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

...

a. Pollers and mirrors discovered by the Main-Primary

b. Server names set

c. Secondary Primary server setup as Primary

c. One server needs to be an Arbiter. A poller can be used for this

c. Mongo 6 installed

In this setup guide we are using example server/host names so you will have to use the names that you have set for your own configuration. For this example we have the required 6 servers for the setup.IMPORTANT :

One server should be set as an Arbiter and in this example we are using Poller1 Server

Main-Primary Server : opha-dev1.opmantek.net

Poller1 Server opha-dev2.opmantek.net [Arbiter Server]

Mirror1 Server opha-dev3.opmantek.net

Poller2 Server opha-dev4.opmantek.net

Mirror2 Server opha-dev5.opmantek.net

Second-Primary opha-dev6.opmantek.net

Run the installation commands on each server as needed.

...

Code Block
languagejson
sh ./opHA-Linux-x86_64-5.0.0.run

VERY IMPORTANT : During the installation of the arbiter server you must answer 'N' at the following prompt

...

...

2. NATS Setup

This configuration should be applied to the Main-Primary, Arbiter, and Secondary Primary servers server ONLY.

  1. Edit Configuration: Update the /etc/nats-server.conf file with the following settings:

  2. Remove or comment out the cluster section

    Code Block
    languagejson
    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#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 
    #  ] 
    #}

...

3. Common Configuration for All Servers

...

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

  2. Add NATS Cluster Server 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 second-primary in the nats_cluster array under server string int the “database“ json object

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

...

4. Server-Specific Configuration

4

...

.

...

and Secondary Primary servers:

Code Block
languagejson
"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.2 Update License

Currently there are 2 available licenses and messagebus will not run without a license.

...

Run the following command

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" } ] })

5.2 Set Default Write Concern

...