Sharding Commands分片命令

Note注意

For details on specific commands, including syntax and examples, click on the specific command to go to its reference page.有关特定命令的详细信息,包括语法和示例,请单击特定命令以转到其参考页。

Name名称Description描述
abortReshardCollection

Aborts a resharding operation.中止重新分片操作

New in version 5.0.在版本5.0中新增

addShardAdds a shard to a sharded cluster.分片添加到分片群集
addShardToZoneAssociates a shard with a zone. Supports configuring zones in sharded clusters.将分片与区域关联。支持在分片集群中配置区域
balancerCollectionStatus

Returns information on whether the chunks of a sharded collection are balanced.返回分片集合的块是否平衡的信息。

New in version 4.4.在版本4.4中新增

balancerStartStarts a balancer thread.启动平衡器线程。
balancerStatusReturns information on the balancer status.返回有关平衡器状态的信息。
balancerStopStops the balancer thread.停止平衡器线程。
checkShardingIndexInternal command that validates index on shard key.验证分片键索引的内部命令。
clearJumboFlagClears the jumbo flag for a chunk.清除块的jumbo标志。
cleanupOrphanedRemoves orphaned data with shard key values outside of the ranges of the chunks owned by a shard.移除分片键值超出分片所拥有的块范围的孤立数据。
cleanupReshardCollection

Cleans up a failed resharding operation.清除失败的重新分片操作

New in version 5.0.在版本5.0中新增

commitReshardCollection

Forces a resharding operation to block writes and complete.强制重新分片操作阻止写入并完成。

New in version 5.0.在版本5.0中新增

enableShardingEnables sharding on a specific database.在特定数据库上启用分片。
flushRouterConfigForces a mongod/mongos instance to update its cached routing metadata.强制mongod/mongos实例更新其缓存的路由元数据。
getShardMapInternal command that reports on the state of a sharded cluster.报告分片集群状态的内部命令。
getShardVersionInternal command that returns the config server version.返回配置服务器版本的内部命令。
isdbgridVerifies that a process is a mongos.验证进程是否为mongos
listShardsReturns a list of configured shards.返回已配置分片的列表。
medianKeyDeprecated internal command. 不推荐使用的内部命令。See splitVector.请参见splitVector
moveChunkInternal command that migrates chunks between shards.在分片之间迁移块的内部命令。
movePrimaryReassigns the primary shard when removing a shard from a sharded cluster.从分片集群中移除分片时重新分配主分片。
mergeChunksProvides the ability to combine chunks on a single shard.提供在单个分片上组合块的能力。
refineCollectionShardKey

Refines a collection's shard key by adding a suffix to the existing key.通过向现有密钥添加后缀来优化集合的分片键。

New in version 4.4.在版本4.4中新增

removeShardStarts the process of removing a shard from a sharded cluster.开始从分片集群中删除分片的过程。
removeShardFromZoneRemoves the association between a shard and a zone. Supports configuring zones in sharded clusters.删除分片和分区之间的关联。支持在分片集群中配置区域
reshardCollection

Initiates a resharding operation to change the shard key for a collection, changing the distribution of your data.启动重新分片操作以更改集合的分片键,从而更改数据的分布。

New in version 5.0.在版本5.0中新增

setAllowMigrationsPrevents the start of new automatic migrations on a collection, prevents in-flight manual migrations from committing, and excludes the collection from new balancer rounds.防止在集合上启动新的自动迁移,防止提交正在进行的手动迁移,并将集合排除在新的平衡器轮次之外。
setShardVersionInternal command to sets the config server version.用于设置配置服务器版本的内部命令。
shardCollectionEnables the sharding functionality for a collection, allowing the collection to be sharded.启用集合的分片功能,允许对集合进行分片。
shardingStateReports whether the mongod is a member of a sharded cluster.报告mongod是否是分片集群的成员。
splitCreates a new chunk.创建一个新
splitVectorInternal command that determines split points.确定拆分点的内部命令。
unsetShardingRemoved in MongoDB 5.0.在MongoDB 5.0中删除。 Internal command that affects connections between instances in a MongoDB deployment.影响MongoDB部署中实例之间连接的内部命令。
updateZoneKeyRangeAdds or removes the association between a range of sharded data and a zone. 添加或删除一系列分片数据与分区之间的关联。Supports configuring zones in sharded clusters.支持在分片集群中配置区域
←  replSetSyncFromabortReshardCollection →