Skip to content

Connecting the Database Server 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 step on the replica set primary.

  1. Add <server_2> to the cluster:

    sudo mongosh --tls --tlsAllowInvalidCertificates --eval "rs.add('<server_2>')"
    

    The output has to contain the following line::

    "ok" : 1

  2. Add <server_3> to the cluster:

    sudo mongosh --tls --tlsAllowInvalidCertificates --eval "rs.add('<server_3>')"
    

    The output has to contain the following line::

    "ok" : 1

  3. Proceed until all servers are added.


Proceed with Securing MongoDB: TLS encryption or user authentication.


Back to top