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

扩展部署

您可以扩展或缩减副本集和分片集群部署,以匹配所需的配置。向上扩展会增加部署中节点和/或分片的数量,从而提高部署的冗余性和可用性。部署的扩展是在相应的自定义资源中配置的。

扩展副本集
To scale your replica set deployment, set the spec.members setting to the desired number of replica set members. To learn more about replication, see Replication in the MongoDB manual.
扩展分片集群

要扩展分片集群部署,请根据需要进行以下设置:

设置
说明

Number of shards in the sharded cluster.

每个分片的节点数。

分片路由器的数量。

配置服务器中的成员数。

To learn more about sharded cluster configurations, see Sharded Cluster Components in the MongoDB manual.

  • Kubernetes Operator 不支持修改部署类型。 例如,您无法将独立运行的实例转换为副本集。要修改部署类型,我们建议执行以下步骤:

    1. 使用所需配置创建新部署。

    2. 根据需要测试应用程序与新部署的连接。

    3. 验证新部署包含所需数据并且应用程序可以访问后,关闭旧部署。

要扩展部署,请根据要扩展的部署配置选择所需的标签页:

1
---
apiVersion: mongodb.com/v1
kind: MongoDB
metadata:
name: <my-replica-set>
spec:
members: 3
version: "8.0.0"
opsManager:
configMapRef:
# Must match metadata.name in ConfigMap file
name: <configMap.metadata.name>
credentials: <mycredentials>
type: ReplicaSet
persistent: true
...
spec:
members: 4
2
kubectl apply -f <repl-set-config>.yaml
给本页内容打分

在此页面上