What is Config Servers in mongoDB

Connect with

MongoDB
Well, config server is basically used when you go for sharding of data, mean to say , for sharded cluster you require config server. If you use replicaset for the config server it means you are basically improves consistency across the config server.

following restriction apply to a replica set configuration when used for config servers:

  • 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:
    sh.status(),
    db.chunks() on config db, 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

If config server 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.


Connect with

Leave a Reply

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