O'Reilly logo

MongoDB High Availability by Afshin Mehrabani

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 command, 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:
    Deploying a replica set
  3. Because we set the fork property ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required