Skip to content

Connecting the Database Servers to the Cluster


After initializing the database cluster on the replica set primary, add the other members of the replica set.

Caution - replica set primary only

Perform the following configuration steps only on the replica set primary.

  1. Open a PowerShell (Administrator).

  2. Add <server_2> to the cluster:

    & "C:\Program Files\MongoDB\Server\4.4\bin\mongo.exe" --tls --tlsAllowInvalidCertificates --eval "rs.add('<server_2>')"
    

    The output has to contain the following line::

    "ok" : 1

  3. Add <server_3> to the cluster:

    & "C:\Program Files\MongoDB\Server\4.4\bin\mongo.exe" --tls --tlsAllowInvalidCertificates --eval "rs.add('<server_3>')"
    

    The output has to contain the following line::

    "ok" : 1

  4. Proceed until all servers are added.


Proceed with Securing MongoDB: TLS encryption or user authentication.


Back to top