Docs 菜单
Docs 主页
/ /
MongoDB 命令行界面
/ / /

mongocli Atlas集群创建

在此页面上

  • 语法
  • 参数
  • 选项
  • 继承选项
  • 示例

Create a MongoDB cluster for your project.

You can create MongoDB clusters using this command. To quickest way to get started is to just specify a name for your cluster and cloud provider and region to deploy, this will create a 3 member replica set with the latest available mongodb server version available. Some of the cluster configuration options are available via flags but for full control of your deployment you can provide a config file.

mongocli atlas clusters create [name] [options]
名称
类型
必需
说明
名称
字符串
false
Name of the cluster. The cluster name cannot be changed after the cluster is created. Cluster name can contain ASCII letters, numbers, and hyphen.
名称
类型
必需
说明
--backup
false
If true, enables Continuous Cloud Backup for your cluster.
--biConnector
false
If true, enables BI Connector for Atlas on the cluster.
--diskSizeGB
float
false
Capacity, in gigabytes, of the host’s root volume. (default 2)
-f, --file
字符串
false
要使用的文件名,带有 json集群配置的可选文件。
-h,--help
false
创建帮助
--mdbVersion
字符串
false
MongoDB version of the cluster to deploy. (default "4.4")
-m, --members
int
false
Number of members in the replica set. (default 3)
-o, --output
字符串
false
Output format. Valid values: json|json-path|go-template|go-template-file
--projectId
字符串
false
要使用的项目ID 。覆盖配置文件或环境变量设置。
--provider
字符串
false
Name of your cloud service provider. Valid values: AWS|AZURE|GCP.
-r, --region
字符串
false
Physical location of your MongoDB cluster. For a complete list of supported AWS regions, see: https://mongodb.com/zh-cn/docs/atlas/reference/amazon-aws/#amazon-aws For a complete list of supported Azure regions, see: https://mongodb.com/zh-cn/docs/atlas/reference/microsoft-azure/#microsoft-azure For a complete list of supported GCP regions, see: https://mongodb.com/zh-cn/docs/atlas/reference/google-gcp/#google-gcp
-s, --shards
int
false
Number of shards in the cluster. (default 1)
--tier
字符串
false
Tier for each data-bearing server in the cluster. (default "M2")
--type
字符串
false
Type of the cluster that you want to create. Valid values: REPLICASET|SHARDED. (default "REPLICASET")
名称
类型
必需
说明
-P, --profile
字符串
false
配置文件中要使用的配置文件。
Deploy a 3 members replica set in AWS
$ mongocli atlas cluster create <clusterName> --projectId <projectId> --provider AWS --region US_EAST_1 --members 3 --tier M10 --mdbVersion 4.2 --diskSizeGB 10
Deploy a 3 members replica set in AZURE
$ mongocli atlas cluster create <clusterName> --projectId <projectId> --provider AZURE --region US_EAST_2 --members 3 --tier M10 --mdbVersion 4.2 --diskSizeGB 10
Deploy a 3 members replica set in GCP
$ mongocli atlas cluster create <clusterName> --projectId <projectId> --provider GCP --region EASTERN_US --members 3 --tier M10 --mdbVersion 4.2 --diskSizeGB 10
Deploy a cluster from a config file
$ mongocli atlas cluster create --projectId <projectId> --file <path/to/cluster.json>

由MongoDB CLI在29 -Jun- 2021自动生成

后退

描述