gpt4 book ai didi

mongodb - AWS CLI 的细微差别

转载 作者:行者123 更新时间:2023-12-03 07:46:30 25 4
gpt4 key购买 nike

我正在尝试使用 AWS CLI 部署 MongoDB 集群。

作为模板,我使用了 MongoDB-VPC.template ,它提供了副本集成员和分片选项的多种变体。如果我使用 AWS GUI,一切都部署得很好,但是当我尝试部署 VIA CLI 时,我只能获得 NAT 实例 + Prime。

下面您可以看到我的提示。

问题是如何指定replicaSet成员的数量,两个或更多。

aws cloudformation create-stack --stack-name i --template-url https://s3.amazonaws.com/quickstart-reference/mongodb/latest/templates/MongoDB-VPC.template --parameters ParameterKey=KeyName,ParameterValue=some-key  --capabilities CAPABILITY_IAM

最佳答案

您需要传递脚本的参数,就像通过 webUI 上的表单发送它一样:

aws cloudformation create-stack 
--stack-name i
--template-url https://s3.amazonaws.com/quickstart-reference/mongodb/latest/templates/MongoDB-VPC.template
--parameters ParameterKey=KeyName,ParameterValue=some-key
ParameterKey=ClusterReplicaSetCount,ParameterValue=4
ParameterKey=ClusterReplicaSetCount,ParameterValue=4
ParameterKey=ClusterReplicaSetCount,ParameterValue=4
ParameterKey=ClusterReplicaSetCount,ParameterValue=4
--capabilities CAPABILITY_IAM

(显然,只设置一次,只是显示在哪里可以设置 CloudFormation 脚本的其他输入参数)

(脚本是一行。为了更好的可读性,将其改为多行。)

来源: Passing Parameters to CloudFormation Stacks with the AWS CLI and Powershell

关于mongodb - AWS CLI 的细微差别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29826553/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com