O'Reilly logo

MongoDB Administrator’s Guide by Cyrus Dasadia

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

How it works...

We begin setting up the sharded cluster by starting a single instance of the config server in step 1. As of MongoDB 3.4, it is required that the config server is set up as a replica set. However, for demonstration purposes, we are only going to run one config server in this replica set. The service runs through the mongod binary with the --configsvr parameter and takes in --dbpath as well as --port. As the config server contains metadata, including authorization details, it does make sense to run it as a replica set while ensuring we maintain optimal backups and monitoring. We will cover more on the latter in future chapters.

In step 2, we connect to the config server using mongo shell and initiate the replica set. This is ...

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