Docs HomeMongoDB Manual

Sharding Commands分片命令

Note

For details on a specific command, including syntax and examples, click on the link to the command's reference page.有关特定命令的详细信息,包括语法和示例,请单击该命令参考页的链接。

Name名称Description描述
abortReshardCollectionAborts 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.将分片与区域关联。支持在分片集群中配置区域
analyzeShardKeyCalculates metrics for evaluating a shard key. 计算用于评估分片键的度量。
New in version 7.0. 7.0版新增。
balancerCollectionStatusReturns 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.停止平衡器线程。
checkMetadataConsistencyPerforms a series of consistency checks on sharding metadata. 对分片元数据执行一系列一致性检查。
New in version 7.0. 7.0版新增。
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.删除分片键值在分片所拥有的区块范围之外的孤立数据。
cleanupReshardCollectionCleans up a failed resharding operation. 清理失败的重新分片操作
New in version 5.0. 5.0版新增。
commitReshardCollectionForces a resharding operation to block writes and complete. 强制重新分片操作以阻止写入并完成。
New in version 5.0. 5.0版新增。
configureCollectionBalancingConfigures balancer settings on a sharded collection.配置分片集合上的平衡器设置。
New in version 5.3. 5.3版新增。
configureQueryAnalyzerConfigures query sampling for a collection. 配置集合的查询采样。
New in version 7.0. 7.0版新增。
enableShardingCreates a database.创建数据库。
flushRouterConfigForces a mongod / mongos instance to update its cached routing metadata.强制mongod/mongos实例更新其缓存的路由元数据。
getShardMapReturns the hostnames and connection strings for shards in the cluster and the config servers for your 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.从分片群集中移除分片时,重新分配primary分片
moveRangeMigrates ranges between shards.迁移范围在分片之间。
mergeAllChunksOnShardSquashes mergeable chunks for a given collection on a shard.对分片上给定集合的可合并块进行挤压。
mergeChunksProvides the ability to combine chunks on a single shard.提供在单个分片上组合块的功能。
refineCollectionShardKeyRefines 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.支持在分片集群中配置区域
reshardCollectionInitiates 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.支持在分片集群中配置区域