What is Config Servers in mongoDB

Connect with

What is Config Servers in mongoDB
What is Config Servers in MongoDB? well, config server MongoDB is basically used when you go for sharding of your data, what does it mean? for a sharded cluster, you require config servers. If you use a replica set for the config server it means you basically improve consistency across the config server MongoDB.

Overview of Config Servers in MongoDB

Following are the restriction which apply to a replica set configuration when used for config servers MongoDB:

  • Must have zero arbiters.
  • Must have no delayed members.
  • must build indexes, it means , no members should have buildIndexes setting to false
  • Standalone and identical mongod servers.
  • There are not all created equal (config string passed to mongos). The first config server in the list is important. in 3 node config server, if you lose 1 or 2 config servers, the cluster continues to function. In this case you can’t modify any metadata or chunksize, etc in the sharded enviroment.

Useful Commands on mongos for config server mongodb

  • sh.status()
  • db.chunks() on config server mongodb
  • sh.enableSharding("dbname")
  • It’s important to remember that all operations over configs, need to be done through the mongos and not directly.

Availability of Config Server mongoDB

If config server in MongoDB replica set loses its primary , it this case , can not elect a primary, it means cluster metadata become read-only. You can read and write data from shards , but no chunck migration or chunk split will ocuur until the replic set can elect primary.

Reference

Suggestions are welcome to improve this post. Happy learning to learn about What is Config Servers in mongoDB.


Connect with

Leave a Comment

Your email address will not be published. Required fields are marked *