Database Reference
In-Depth Information
7. As you can see in the preceding screenshot, after a while,
mon-
god2.replicaset.com
becomes primary. In the secondary machine's
mongo
shell, you can see the result shown in the following screenshot:
8. The
mongod
object goes to the
recovering
mode, and after a while, you can
see the status of the
secondary
node becomes
secondary
. The reason for us-
ing the
recovering
mode at first is to sync the data with the
primary
node.
Note
Usually, syncing takes less than a minute for an empty dataset, but if you're run-
ning the replica set on an existing
dbpath
object, it depends on the size of
oplog
.
9. After syncing data between
primary
and
secondary
nodes, you can see the
following status page from the
primary
node: