Exploring the config database in a sharded setup

Config database is the backbone of a sharded setup in Mongo. It stores all the metadata of the shard setup and has a dedicated mongod process running for it. When a mongos process is started we provide it with the config servers' URL. In this recipe, we will take a look at some collections in the config database and dive deep into their content and significance.

Getting ready

We need a sharded setup for this recipe. Refer to the recipe Starting a simple sharded environment of two shard in Chapter 1, Installing and Starting the Server for information on how to start a simple shard. Additionally, connect to the mongos process from a shell.

How to do it…

  1. From the console connected to the mongos process, ...

Get MongoDB Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.