The sharding options in the mongod.conf file include three sharding.* directives, as well as two related directives (replication.replSetname and net.bindIp), as summarized here:
- sharding.clusterRole:Â The value for this directive is in the form of a string and can be either configsvr or shardsvr. If the value is set to configsvr, the mongod instance starts listening on port 27019 by default. The instance then starts acting as a config server, handling shard-related metadata. If, on the other hand, the value is set to shardsvr, the mongod instance listens on port 27018 by default and is able to handle MongoDB data, including the ability to handle shards.
- sharding.archiveMovedChunks:Â This directive is in the form of a Boolean value. The default is false, meaning that documents residing in chunks that have migrated out of the shard, either through a manual operation (discussed in the next chapter) or by means of the balancer, are not saved...