On this page本页内容
shardConnPoolStats
Removed in MongoDB 5.0.在MongoDB 5.0中删除。 Use 请改用connPoolStats
instead.connPoolStats
。
Returns information on the pooled and cached connections in the sharded connection pool. 返回分片连接池中的池连接和缓存连接的信息。The command also returns information on the per-thread connection cache in the connection pool.该命令还返回连接池中每线程连接缓存的信息。
The shardConnPoolStats
command uses the following syntax:shardConnPoolStats
命令使用以下语法:
{ shardConnPoolStats: 1 }
The sharded connection pool is specific to connections between members in a sharded cluster. 分片连接池特定于分片集群中成员之间的连接。The 集群中的mongos
instances in a cluster use the connection pool to execute client reads and writes. mongos
实例使用连接池执行客户端读写。The 集群中的mongod
instances in a cluster use the pool when issuing mapReduce
to query temporary collections on other shards.mongod
实例在发出mapReduce
查询其他分片上的临时集合时使用该池。
When the cluster requires a connection, MongoDB pulls a connection from the sharded connection pool into the per-thread connection cache. 当集群需要连接时,MongoDB将一个连接从分片连接池拉到每线程连接缓存中。MongoDB returns the connection to the connection pool after every operation.MongoDB在每次操作后都会将连接返回到连接池。
shardConnPoolStats.hosts
Displays connection status for each config server, replica set, and standalone instance in the cluster.显示群集中每个配置服务器、副本集和独立实例的连接状态。
shardConnPoolStats.hosts.<host>.available
The number of connections available for this host to connect to the 此主机可连接到mongo的连接数。mongos
.
shardConnPoolStats.replicaSets
Displays information specific to replica sets.显示特定于副本集的信息。
shardConnPoolStats.replicaSets.<name>.host
Holds an array of documents that report on each replica set member. 保存报告每个副本集成员的文档数组。These values derive from the replica set status values.这些值源自副本集状态值。
shardConnPoolStats.replicaSets.<name>.host[n].addr
The host address in the format 主机地址,格式为[hostname]:[port]
.[hostname]:[port]
。
shardConnPoolStats.replicaSets.<name>.host[n].ok
This field is for internal use. 此字段供内部使用。Reports 当false
when the mongos
either cannot connect to instance or received a connection exception or error.mongos
无法连接到实例或收到连接异常或错误时,报告false
。
shardConnPoolStats.replicaSets.<name>.host[n].ismaster
The host is the replica set's primary if this is 如果这是true
.true
,则主机是副本集的primary。
shardConnPoolStats.replicaSets.<name>.host[n].hidden
The host is a hidden member of the replica set if this is 如果这是true
.true
,则主机是副本集的隐藏成员。
shardConnPoolStats.replicaSets.<name>.host[n].secondary
The host is a hidden member of the replica set if this is 如果这是true
.true
,则主机是副本集的隐藏成员。
The host is a secondary member of the replica set if this is 如果这是true
.true
,则主机是副本集的secondary成员。
shardConnPoolStats.replicaSets.<name>.host[n].pingTimeMillis
The latency, in milliseconds, from the 从mongos
to this member.mongos
到该成员的延迟(毫秒)。
shardConnPoolStats.replicaSets.<name>.host[n].tags
A tags
document contains user-defined tag field and value pairs for the replica set member.tags
文档包含复制集成员的用户定义标记字段和值对。
{ "<tag1>": "<string1>", "<tag2>": "<string2>",... }
settings.getLastErrorModes
and settings.getLastErrorDefaults
.settings.getLastErrorModes
和settings.getLastErrorDefaults
创建自定义写入问题。For more information, see Configure Replica Set Tag Sets.有关详细信息,请参阅配置副本集标记集。
shardConnPoolStats.createdByType
The number connections in the cluster's connection pool.群集连接池中的连接数。
shardConnPoolStats.totalAvailable
The number of connections available from the 从mongos
to the config servers, replica sets, and standalone mongod
instances in the cluster.mongos
到集群中的配置服务器、副本集和独立mongod
实例的可用连接数。
shardConnPoolStats.totalCreated
The number of connections the mongos
has ever created to other members of the cluster.mongos
曾经创建的与集群其他成员的连接数。
shardConnPoolStats.threads
Displays information on the per-thread connection cache.显示每线程连接缓存的信息。
shardConnPoolStats.threads.hosts
Displays each incoming client connection. 显示每个传入的客户端连接。For a 对于mongos
, this array field displays one document per incoming client thread. mongos
,此数组字段为每个传入的客户端线程显示一个文档。For a 对于mongod
, the array displays one entry per incoming sharded mapReduce
client thread.mongod
,数组为每个传入的分片mapReduce
客户端线程显示一个条目。
shardConnPoolStats.threads.hosts.host
The host using the connection. 使用连接的主机。The host can be a config server, replica set, or standalone instance.主机可以是配置服务器、副本集或独立实例。