对于 AI 代理:可在 https://www.mongodb.com/zh-cn/docs/llms.txt 获取文档索引—通过在任何 URL 路径后添加 .md 可获取所有页面的 Markdown 版本。
Docs 菜单

示例:副本集到分片集群的实时迁移

重要

The feature described on this page is not currently supported on Atlas Infinite clusters during public preview. For the features supported in public preview, see Public Preview Availability.

您可以选择将源副本集实时迁移到分片的目标集群。在这种情况下,您可以在实时迁移Atlas用户界面中指定分片配置,类似于以下示例。

MongoDB shards only those collections that you include into the shardingEntries array. The array specifies which collections to shard. To learn more, see Sharding.

如果您选择在迁移期间省略分片配置,则可以在将集群迁移到 Atlas 后对目标集群上的collection进行分片。

{
"shardingEntries": [
{
"database": "database-name",
"collection": "collection-name",
"shardCollection": {
"key": [
{ "location": 1 },
{ "region": 1 }
]
}
}
]
}

除了此配置之外,Atlas 目标集群还需要与指定分片键兼容的索引。 通过 Atlas 用户界面启动迁移时,可以将 MongoDB 配置为自动创建这些支持索引。

要了解详情,请参阅:

给本页内容打分