作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 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/
我是一名优秀的程序员,十分优秀!