We have already examined replication settings in detail in the Replication configuration settings section of this chapter. As we are now ready to deploy the replica set, a simple Docker command shows the current mongod.conf file settings. As a minimum, we need to ensure that database is listening on the correct IP address (or all IP addresses, as seen in the preceding screenshot). We also need to confirm that all replica set members have the replication.replSetName parameter set to the same name. The next screenshot shows the result of the following Docker command:
docker exec -it learn-mongo-member-1 /bin/bash -c "cat /etc/mongod.conf"
Here is the result of the preceding command:
Assuming all the replica set members have the appropriate configuration, we will now have a look at starting (or restarting) the mongod instances involved in the replica set.