Database Reference
In-Depth Information
4. For the next steps, you should use
mongo
interactive shell to run and configure
the replica set.
5. Run the
mongo
command from your command environment and you will get the
following screenshot:
6. Then, run the following command in
mongo
to initiate the replica set:
rs.initiate()
7. After executing the preceding command, you should see a result similar to the
one depicted in the following screenshot:
If the initialization of the replica set is successful, you will see the
ok: 1
mes-
sage from the
mongo
process.
Using the
rs.conf()
command in
mongo
, you can get the replica set configur-
ation. The following screenshot shows the output of this command:
As you can see, the
_id
property shows the name of our replica set, and we currently
have only one member, the
primary
node.