“文档” 菜单
文档首页
/ /
Atlas
/ /

atlas clusters update

在此页面上

  • 语法
  • 参数
  • 选项
  • 继承选项
  • 输出
  • 举例

修改指定集群的设置。

您可以使用 --file 标志在 JSON 配置文件中指定修改。

您无法更改集群的名称或降级集群的 MongoDB 版本。

您只能将副本集更新为单分片集群;您无法将副本集更新为多分片集群。 要了解更多信息,请参阅 https://www.mongodb.com/zh-cn/docs/atlas/scale-cluster/#convert-a-replica-set-to-a-sharded-clusterhttps://www.mongodb.com/zh-cn/docs/upcoming/tutorial/convert-replica-set-to-replicated-shard-cluster。

要使用此命令,您必须使用具有项目集群经理角色的用户帐户或 API 密钥进行身份验证。Atlas 仅对 M10+ 集群支持此命令

命令语法
atlas clusters update [clusterName] [options]
名称
类型
必需
说明
集群名称
字符串
false
要更新的集群的名称。
名称
类型
必需
说明
--disableTerminationProtection
false

禁用集群的终止保护。 您可以删除已禁用终止保护的集群。

与 --enableTerminationProtection、--file 互斥。

--diskSizeGB
浮动
false

主机根卷的容量(以 GB 为单位)。

与 --文件 互斥。

--enableTerminationProtection
false

为集群启用终止保护。 无法删除已启用终止保护的集群。

与 --disableTerminationProtection、文件 互斥。

-f, --file
字符串
false

定义集群设置的可选 JSON 配置文件的路径。要了解有关 Atlas CLI 集群配置文件的更多信息,请参阅 https://dochub.mongodb.org/core/cluster-config-file-atlascli。

与 --层级、--diskSizeGB、--enableTerminationProtection、--disableTerminationProtection、--tag 互斥。

-h,--help
false
更新帮助
--mdbVersion
字符串
false
集群的主要 MongoDB 版本。
-o, --output
字符串
false
输出格式。 有效值为 json、json-path、go-template 或 go-template-file。 要查看完整输出,请使用 -o json 选项。
--projectId
字符串
false
标识要使用的项目的十六进制字符串。 此选项会覆盖配置文件或环境变量中的设置。
--tag
key=value
false

包含长度在 1 到 255 个字符之间的键值对的列表,用于对集群进行标记和分类。 传递此标志会替换先前存在的数据。

与 --文件 互斥。

--tier
字符串
false

集群中每个数据承载服务器的层级。 要了解有关集群层的更多信息,请参阅 https://dochub.mongodb.org/core/cluster-tier-atlas。

与 --文件 互斥。

名称
类型
必需
说明
-P, --profile
字符串
false
要从配置文件中使用的配置文件的名称。 要了解 Atlas CLI 的配置文件,请参阅 https://dochub.mongodb.org/core/atlas-cli-save-connection-settings。

如果命令成功,CLI 将返回类似于以下示例的输出。 括号中的值代表您的价值观。

Updating cluster '<Name>'.
# Update the tier for a cluster named myCluster for the project with ID 5e2211c17a3e5a48f5497de3:
atlas cluster update myCluster --projectId 5e2211c17a3e5a48f5497de3 --tier M50
# Replace tags cluster named myCluster for the project with ID 5e2211c17a3e5a48f5497de3:
atlas cluster update myCluster --projectId 5e2211c17a3e5a48f5497de3 --tag key1=value1
# Remove all tags from cluster named myCluster for the project with ID 5e2211c17a3e5a48f5497de3:
atlas cluster update myCluster --projectId 5e2211c17a3e5a48f5497de3 --tag =
# Update the disk size for a cluster named myCluster for the project with ID 5e2211c17a3e5a48f5497de3:
atlas cluster update myCluster --projectId 5e2211c17a3e5a48f5497de3 --diskSizeGB 20
# Update the MongoDB version for a cluster named myCluster for the project with ID 5e2211c17a3e5a48f5497de3:
atlas cluster update myCluster --projectId 5e2211c17a3e5a48f5497de3 --mdbVersion 5.0
# Use a configuration file named cluster-config.json to update a cluster named myCluster for the project with ID 5e2211c17a3e5a48f5497de3:
atlas cluster update myCluster --projectId 5e2211c17a3e5a48f5497de3 --file cluster-config.json --output json

后退

开始

来年

升级