@@ -9,7 +9,7 @@ mongocli atlas cluster create
9
9
.. contents:: On this page
10
10
:local:
11
11
:backlinks: none
12
- :depth: 1
12
+ :depth: 2
13
13
:class: singlecol
14
14
15
15
.. include:: /includes/styles/corrections.rst
@@ -30,16 +30,18 @@ Syntax
30
30
31
31
mongocli atlas cluster create <cluster-name>
32
32
[ --backup ]
33
- [ --tier <cluster-tier> ]
34
33
[ --diskSizeGB <size-of-disk> ]
35
34
[ --file|-f <path-to-cluster-config-file> ]
36
35
[ --mdbVersion <mongodb-version> ]
37
36
[ --members|-m <number-of-members> ]
38
- [ --projectId <project-ID> ]
39
37
[ --profile|-P <profile-name> ]
38
+ [ --projectId <project-ID> ]
40
39
--provider AWS|GCP|AZURE
41
40
--region|-r <region-name>
42
-
41
+ [ --shards|-s <number-of-shards> ]
42
+ [ --tier <cluster-tier> ]
43
+ [ --type <replicaset-or-sharded>]
44
+
43
45
.. include:: /includes/fact-command-line-help.rst
44
46
45
47
.. _atlas-cluster-create-options:
@@ -56,15 +58,6 @@ Options
56
58
- Description
57
59
- Required?
58
60
59
- * - ``--backup``
60
- -
61
- - Flag to enable :atlas:`backup </backup-cluster>` on
62
- ``M10`` and larger clusters. This option is not available
63
- for clusters smaller than ``M10``. If omitted, :atlas:`cloud
64
- provider snapshots </backup/cloud-provider-snapshots>` is
65
- disabled.
66
- - no
67
-
68
61
* - ``<cluster-name>``
69
62
- string
70
63
- Name of the cluster. The cluster name cannot
@@ -73,12 +66,13 @@ Options
73
66
hyphen.
74
67
- yes
75
68
76
- * - ``--tier``
77
- - string
78
- - Name of the :atlas:`cluster tier </cluster-tier/>` you want to
79
- use. You can later modify your cluster tier with the
80
- :ref:`mongocli atlas cluster update <mcli-atlas-cluster-update-command>`
81
- command. If omitted, uses the tier ``M2``.
69
+ * - ``--backup``
70
+ -
71
+ - Flag to enable :atlas:`backup </backup-cluster>` on
72
+ ``M10`` and larger clusters. This option is not available
73
+ for clusters smaller than ``M10``. If omitted, :atlas:`cloud
74
+ provider snapshots </backup/cloud-provider-snapshots>` is
75
+ disabled.
82
76
- no
83
77
84
78
* - ``--diskSizeGB``
@@ -134,8 +128,7 @@ Options
134
128
135
129
* - ``--members``, ``-m``
136
130
- integer
137
- - Number of members in the :atlas:`replica set
138
- </reference/glossary/#term-replica-set>`. The
131
+ - Number of members in the :term:`replica set`. The
139
132
default value is ``3``.
140
133
- no
141
134
@@ -206,6 +199,34 @@ Options
206
199
207
200
- yes
208
201
202
+ * - ``--shards``, ``-s``
203
+ - integer
204
+ - Number of shards in the :term:`sharded cluster`. The
205
+ default value is ``1``, which is equivalent to a replica set.
206
+ - no
207
+
208
+ * - ``--tier``
209
+ - string
210
+ - Name of the :atlas:`cluster tier </cluster-tier/>` you want to
211
+ use. You can later modify your cluster tier with the
212
+ :ref:`mongocli atlas cluster update <mcli-atlas-cluster-update-command>`
213
+ command. If omitted, uses the tier ``M2``.
214
+ - no
215
+
216
+ * - ``--type``
217
+ - string
218
+ - Type of cluster to deploy. Value can be:
219
+
220
+ - ``REPLICASET`` to deploy a
221
+ :term:`replica set`,
222
+ or
223
+
224
+ - ``SHARDED`` to deploy a
225
+ :term:`sharded cluster`.
226
+
227
+ By default, deploys a replica set.
228
+ - no
229
+
209
230
.. _atlas-cluster-create-output-fields:
210
231
211
232
Output
@@ -220,15 +241,15 @@ Output
220
241
Examples
221
242
--------
222
243
223
- Example 1
224
- ~~~~~~~~~
244
+ Create a Cluster
245
+ ~~~~~~~~~~~~~~~~
225
246
226
247
The following ``mongocli atlas cluster create`` command creates a sample
227
248
``M2`` cluster named ``myCluster`` in the AWS region ``US_EAST_1`` with
228
249
``3`` nodes. The command uses the {+default-profile+},
229
250
which contains the public and private keys for accessing |service|.
230
251
231
- .. code-block:: text
252
+ .. code-block:: sh
232
253
:copyable: false
233
254
234
255
mongocli atlas cluster create myCluster --projectId 5e2211c17a3e5a48f5497de3 --provider AWS --region US_EAST_1 --members 3 --tier M2 --mdbVersion {+mdbVersion+} --diskSizeGB 10
@@ -297,8 +318,8 @@ these fields, see :ref:`Output <atlas-cluster-create-output-fields>`.
297
318
"stateName": "CREATING"
298
319
}
299
320
300
- Example 2
301
- ~~~~~~~~~
321
+ Create a Cluster using a Configuration File
322
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
302
323
303
324
The following ``mongocli atlas cluster create`` command creates a
304
325
sample ``M40`` cluster named ``myCluster`` in the |aws| region
@@ -417,3 +438,100 @@ these fields, see :ref:`Output <atlas-cluster-create-output-fields>`.
417
438
],
418
439
"stateName": "CREATING"
419
440
}
441
+
442
+ Create a Sharded Cluster
443
+ ~~~~~~~~~~~~~~~~~~~~~~~~
444
+
445
+ The following ``mongocli atlas cluster create`` command creates a sample
446
+ ``M10`` sharded cluster named ``myShardedCluster`` in the |gcp| region
447
+ ``EASTERN_US`` with ``2`` shards and ``3`` nodes per shard. The command
448
+ uses the {+default-profile+}, which contains the public and private
449
+ keys for accessing |service|, as well as a default project ID.
450
+
451
+ .. code-block:: sh
452
+ :copyable: false
453
+
454
+ mongocli atlas cluster create myShardedCluster \
455
+ --provider GCP \
456
+ --region EASTERN_US \
457
+ --type SHARDED \
458
+ --shards 2 \
459
+ --members 3 \
460
+ --tier M10 \
461
+ --mdbVersion {+mdbVersion+} \
462
+ --diskSizeGB 10
463
+
464
+ The command returns the following to the terminal. To learn more about
465
+ these fields, see :ref:`Output <atlas-cluster-create-output-fields>`.
466
+
467
+ .. code-block:: json
468
+ :copyable: false
469
+
470
+ {
471
+ "autoScaling": {
472
+ "diskGBEnabled": true,
473
+ "compute": {
474
+ "enabled": false,
475
+ "scaleDownEnabled": false
476
+ }
477
+ },
478
+ "backupEnabled": false,
479
+ "biConnector": {
480
+ "enabled": false,
481
+ "readPreference": "secondary"
482
+ },
483
+ "clusterType": "SHARDED",
484
+ "diskSizeGB": 10,
485
+ "encryptionAtRestProvider": "NONE",
486
+ "labels": [
487
+ {
488
+ "key": "Infrastructure Tool",
489
+ "value": "mongoCLI"
490
+ }
491
+ ],
492
+ "id": "5efe19b205e4b2501fb14374",
493
+ "groupId": "5dd6fab7493979f10faffb78",
494
+ "mongoDBVersion": "4.2.8",
495
+ "mongoDBMajorVersion": "4.2",
496
+ "mongoURIUpdated": "2020-07-02T17:30:25Z",
497
+ "name": "testShard",
498
+ "numShards": 2,
499
+ "paused": false,
500
+ "pitEnabled": false,
501
+ "providerBackupEnabled": false,
502
+ "providerSettings": {
503
+ "instanceSizeName": "M10",
504
+ "providerName": "GCP",
505
+ "regionName": "EASTERN_US",
506
+ "autoScaling": {
507
+ "compute": {}
508
+ }
509
+ },
510
+ "replicationFactor": 3,
511
+ "replicationSpec": {
512
+ "EASTERN_US": {
513
+ "analyticsNodes": 0,
514
+ "electableNodes": 3,
515
+ "priority": 7,
516
+ "readOnlyNodes": 0
517
+ }
518
+ },
519
+ "replicationSpecs": [
520
+ {
521
+ "id": "505e4b24efe19b1fb1437429",
522
+ "numShards": 2,
523
+ "zoneName": "Zone 1",
524
+ "regionsConfig": {
525
+ "EASTERN_US": {
526
+ "analyticsNodes": 0,
527
+ "electableNodes": 3,
528
+ "priority": 7,
529
+ "readOnlyNodes": 0
530
+ }
531
+ }
532
+ }
533
+ ],
534
+ "stateName": "CREATING",
535
+ "connectionStrings": {}
536
+ }
537
+
0 commit comments