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描述
verboseboolean

Optional. 可选。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个或更多的块,块在分片上的分布的完整细节,以及每个分片上的块数。
  • 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个或更多的块,该方法会返回太多的块来打印…消息,只显示每个分片上的块数。
  • 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中运行的dbprintShardingStatus()方法不返回JSONUse db.printShardingStatus() for manual inspection, and Config Database in scripts.使用db.printShardingStatus()进行手动检查,并在脚本中配置数据库。

Tip提示
See also: 参阅:
←  db.printSecondaryReplicationInfo()db.printSlaveReplicationInfo() →