When run on a
mongosinstance, prints a formatted report of the sharding configuration and the information regarding existing chunks in a sharded cluster. The default behavior suppresses the detailed chunk information if the total number of chunks is greater than or equal to 20.
sh.status()method has the following parameter:
Parameter Type Description
Optional. Determines the level of verbosity.
true, the method displays:
- Full details of the chunk distribution across shards even if you have 20 or more chunks, as well as the number of chunks on each shard.
- Details of active mongos instances.
false, the method displays:
- Full details of the chunk distribution across shards only if you have less than 20 chunks. If you have 20 or more chunks, the method instead returns a
too many chunks to print ...message, showing only the number of chunks on each shard.
- Only the version and number of active mongos instances.
The default verbose value is
The Shards section lists information on the shard(s). For each shard, the section displays the name, host, and the associated tags, if any.
If the method is run with the
verbose parameter to true, the Active mongos Instances section displays additional information:
The Autosplit displays information on whether autosplit is enabled:
The Sharded Collection section provides information on the sharding details for sharded collection(s). For each sharded collection, the section displays the shard key, the number of chunks per shard(s), the distribution of chunks across shards , and the tag information, if any, for shard key range(s).
New in version 3.2.
sh.status.active-mongoseslists the version and count of the active
mongosinstances that have been ping’ed within the last 60 seconds.
true, returns for each active
- Its hostname and port.
- An array of the instance’s fully qualified domain names (FQDNs).
- Its MongoDB version.
- Its most recent ping date and time.
- Its uptime since the last ping.
- Its waiting status.
sh.status.active-mongosesindicates whether autosplit is currently enabled.