Docs HomeMongoDB Manual

db.printShardingStatus()

On this page本页内容

Definition定义

db.printShardingStatus()

Prints a formatted report of the sharding configuration and the information regarding existing chunks in a sharded cluster.打印分片配置的格式化报告以及关于分片集群中现有块的信息。

Only use db.printShardingStatus() when connected to a mongos instance.仅在连接到mongos实例时使用db.printShardingStatus()

The db.printShardingStatus() method has the following parameter:db.printShardingStatus()方法具有以下参数:

Parameter参数Type类型Description描述
verbosebooleanOptional.可选的。Determines the level of verbosity.确定详细程度。
If true, the method displays: 如果为true,则该方法显示:
  • 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.即使你有20个或20个以上的区块,区块在分片之间分布的完整细节,以及每个分片上的区块数量。
  • Details of active mongos instances.活动mongos实例的详细信息。
If false, the method displays: 如果为false,则该方法显示:
  • Full details of the chunk distribution across shards only if you have less than 20 chunks. 只有当你拥有少于20个区块时,区块在分片之间分布的完整细节。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.如果你有20个或更多的块,该方法会返回too many chunks to print ...消息,只显示每个分片上的块数。
  • Only the version and number of active mongos instances.仅活动mongos实例的版本和数量
The default verbose value is false. 默认的详细值为false

See sh.status() for details of the output.有关输出的详细信息,请参阅sh.status()

Note

The db.printShardingStatus() method run in mongosh does not return JSON. mongosh中运行的db.printShardingStatus()方法不返回JSON。Use db.printShardingStatus() for manual inspection, and Config Database in scripts.使用db.printShardingStatus()进行手动检查,并在脚本中配置数据库。

Tip

See also: 另请参阅:

sh.status()