Database Reference
In-Depth Information
Deploying a replica set
Having completed the initialization steps, we can now start to define our first replica set.
First of all, you need to run the
mongod
process on all machines through the following
steps:
1. Make sure that you have the configuration file in your machine, and then run the
following command:
mongod --config /etc/mongodb.conf
Note
In Unix operating systems, if you don't have sufficient permissions to run the com-
mand, you can use the
sudo
prefix. So the complete command will be
sudo
mongod --config /etc/mongodb.conf
.
2. After issuing the command, you should see the result depicted in the following
screenshot:
3. Because we set the fork property to true,
mongod
will run as a daemon in the
background. So, in order to see the logs and outputs of
mongod
, you should use
the defined
logpath
file. You can see the logfile content as shown in the follow-
ing screenshot: