- Sharding >
- Sharded Cluster Administration >
- View Cluster Configuration
View Cluster Configuration¶
List Databases with Sharding Enabled¶
To list the databases that have sharding enabled, query the
databases
collection in the Config Database.
A database has sharding enabled if the value of the partitioned
field is true
. Connect to a mongos
instance with a
mongo
shell, and run the following operation to get a full
list of databases with sharding enabled:
Example
You can use the following sequence of commands to return a list of all databases in the cluster:
If this returns the following result set:
Then sharding is only enabled for the animals
database.
List Shards¶
To list the current set of configured shards, use the listShards
command, as follows:
View Cluster Details¶
To view cluster details, issue db.printShardingStatus()
or
sh.status()
. Both methods return the same output.
Example
In the following example output from sh.status()
sharding version
displays the version number of the shard metadata.shards
displays a list of themongod
instances used as shards in the cluster.databases
displays all databases in the cluster, including database that do not have sharding enabled.- The
chunks
information for thefoo
database displays how many chunks are on each shard and displays the range of each chunk.