Hello Everyone, This question is generic to understand how mongodb bootstrap the replication for the first time to get the clear picture.
In Course : M103 > Chapter 2 (Replication) > [Lecture: Setting Up a Replica Set] > [Time - 3:45 ]
Trainer explains to create one user for replication on primary node where we ran rs.initiate(). Later we have to login to PRIMARY NODE using new created user and eventually add remaining nodes.
Now the questions i have are :
- How the other nodes get added for the first time without passing authentication details? (since all nodes are started with authorization: enabled, meaning we require credentials to authenticate) though following command doesn’t have any authentication details in it.
- What exactly is the role of user being created in replication if not being passed explicitly anywhere? Since we’ve already created openssl key file and placed path on all secondary nodes already. How does authentication happens behind the scene between primary and secondary nodes?
- How is the existing data shipped from primary node to other nodes once there are added for first time (like snapshot of primary node gets copied to other nodes?) and what is the performance impact on the primary node while at the time of adding secondary nodes if data size is in TBs?
Thanks in Advance.