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.-
Open a PowerShell (Administrator).
-
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
-
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
-
Proceed until all servers are added.
Proceed with Securing MongoDB: TLS encryption or user authentication.