|
| 1 | +.. _atlas-cli-cluster-config-file: |
| 2 | + |
| 3 | +============================== |
| 4 | +{+Cluster+} Configuration File |
| 5 | +============================== |
| 6 | + |
| 7 | +.. contents:: On this page |
| 8 | + :local: |
| 9 | + :backlinks: none |
| 10 | + :depth: 1 |
| 11 | + :class: singlecol |
| 12 | + |
| 13 | +You can use a {+cluster+} configuration file to specify the settings |
| 14 | +required when you create or update a {+cluster+} using the |
| 15 | +{+atlas-cli+}. The {+atlas-cli+} accepts ``.json`` |
| 16 | +{+cluster+} configuration files. |
| 17 | + |
| 18 | +Use the following resources to: |
| 19 | + |
| 20 | +- Learn the :ref:`required settings <required-cluster-settings>` you |
| 21 | + can specify in the {+cluster+} configuration file. |
| 22 | +- View and copy :ref:`sample configuration files |
| 23 | + <example-cluster-config-file>`. |
| 24 | + |
| 25 | +.. _required-cluster-settings: |
| 26 | + |
| 27 | +Required {+Cluster+} Settings |
| 28 | +----------------------------- |
| 29 | + |
| 30 | +|service| requires the following settings to create a {+cluster+} with |
| 31 | +the {+atlas-cli+}. You must specify these {+cluster+} settings either |
| 32 | +in the configuration file or as flags in the command: |
| 33 | + |
| 34 | +.. list-table:: |
| 35 | + :header-rows: 1 |
| 36 | + :widths: 20 10 70 |
| 37 | + |
| 38 | + * - Field |
| 39 | + - Type |
| 40 | + - Description |
| 41 | + |
| 42 | + * - ``clusterType`` |
| 43 | + - string |
| 44 | + - Human-readable label that indicates the type of {+cluster+} to |
| 45 | + create. Values include: ``REPLICASET``, ``SHARDED``, or |
| 46 | + ``GEOSHARDED``. |
| 47 | + |
| 48 | + * - ``name`` |
| 49 | + - string |
| 50 | + - Human-readable label that identifies the {+cluster+}. |
| 51 | + |
| 52 | + * - ``replicationSpecs`` |
| 53 | + - array |
| 54 | + - List that contains the configuration settings for your |
| 55 | + {+cluster+} regions and the hardware provisioned in them. |
| 56 | + |
| 57 | + * - ``replicationSpecs.`` |
| 58 | + ``regionConfigs`` |
| 59 | + - array |
| 60 | + - List that contains the hardware specifications for the nodes set |
| 61 | + within the region that you specify. Each ``regionConfigs`` |
| 62 | + object describes the region's priority in elections and the |
| 63 | + number and type of MongoDB nodes that |service| deploys to the |
| 64 | + region. |
| 65 | + |
| 66 | + Each ``regionConfigs`` object must have either an |
| 67 | + ``analyticsSpecs`` object, ``electableSpecs`` object, or |
| 68 | + ``readOnlySpecs`` object. |
| 69 | + |
| 70 | + - Shared {+clusters+} require only ``electableSpecs``. |
| 71 | + - Dedicated {+clusters+} can specify any of these |
| 72 | + specifications, but must have at least one ``electableSpecs`` |
| 73 | + object within a ``replicationSpec``. |
| 74 | + - Every hardware specification must use the same |
| 75 | + ``instanceSize``. |
| 76 | + |
| 77 | + * - ``replicationSpecs.`` |
| 78 | + ``regionConfigs.electableSpecs`` |
| 79 | + - object |
| 80 | + - Hardware specifications for electable nodes in the region. |
| 81 | + Electable nodes can become the |
| 82 | + :manual:`primary </core/replica-set-members/#std-label-replica-set-primary-member>` and can enable |
| 83 | + local reads. |
| 84 | + |
| 85 | + * - ``replicationSpecs.`` |
| 86 | + ``regionConfigs.`` |
| 87 | + ``electableSpecs.instanceSize`` |
| 88 | + - string |
| 89 | + - Hardware specification for the instance sizes in this region. To |
| 90 | + learn more, see :ref:`create-cluster-instance`. |
| 91 | + |
| 92 | + * - ``replicationSpecs`` |
| 93 | + ``.regionConfigs.`` |
| 94 | + ``electableSpecs.nodeCount`` |
| 95 | + - number |
| 96 | + - Number of electable nodes for |service| to deploy to the region. |
| 97 | + Electable nodes can become the |
| 98 | + :manual:`primary </core/replica-set-members/#std-label-replica-set-primary-member>` and can enable |
| 99 | + local reads. |
| 100 | + |
| 101 | + The combined electableSpecs.nodeCount across all |
| 102 | + replicationSpecs[n].regionConfigs[m] objects must total 3, 5, or |
| 103 | + 7. |
| 104 | + |
| 105 | + * - ``replicationSpecs.`` |
| 106 | + ``regionConfigs.priority`` |
| 107 | + - Integer |
| 108 | + - Precedence that is given to this region when a primary election |
| 109 | + occurs. |
| 110 | + |
| 111 | + If your region has set ``electableSpecs.nodeCount`` to ``1`` or |
| 112 | + higher, it must have a priority of exactly one (1) less than |
| 113 | + another region in the ``replicationSpecs[n].regionConfigs[m]`` |
| 114 | + array. The highest-priority region must have a priority of |
| 115 | + ``7``. The lowest possible priority is ``1``. |
| 116 | + |
| 117 | + The priority ``7`` region identifies the preferred region of the |
| 118 | + {+cluster+}. |service| places the |
| 119 | + :manual:`primary </core/replica-set-members/#std-label-replica-set-primary-member>` node in the |
| 120 | + preferred region. |
| 121 | + |
| 122 | + * - ``replicationSpecs.`` |
| 123 | + ``regionConfigs.providerName`` |
| 124 | + - string |
| 125 | + - Human-readable label that identifies your cloud service |
| 126 | + provider. Values include: ``AWS``, ``AZURE``, or ``GCP``. |
| 127 | + |
| 128 | + To create a multi-cloud {+cluster+}, specify more than one |
| 129 | + service provider for your ``regionConfigs`` objects. To |
| 130 | + learn more, see the :ref:`multi-cloud example configuration file |
| 131 | + <multi-cloud-example-cluster-config-file>` |
| 132 | + |
| 133 | + * - ``replicationSpecs.`` |
| 134 | + ``regionConfigs.regionName`` |
| 135 | + - string |
| 136 | + - Human-readable label that indicates the physical location of |
| 137 | + your {+cluster+} nodes. The region you choose can affect network |
| 138 | + latency for clients accessing your databases. |
| 139 | + |
| 140 | + For a complete list of region name values, refer to the the |
| 141 | + cloud provider reference pages: |
| 142 | + |
| 143 | + - :atlas:`AWS </reference/amazon-aws/#amazon-aws>>` |
| 144 | + - :atlas:`GCP </reference/google-gcp/#google-gcp>` |
| 145 | + - :atlas:`Azure </reference/microsoft-azure/#microsoft-azure>` |
| 146 | + |
| 147 | +.. _optional-cluster-settings: |
| 148 | + |
| 149 | +Optional and Conditional {+Cluster+} Settings |
| 150 | +--------------------------------------------- |
| 151 | + |
| 152 | +Your {+cluster+} configuration file may contain additional optional or |
| 153 | +conditional {+cluster+} settings. For a full list of available |
| 154 | +settings, see the API documentation for |
| 155 | +:atlas:`Create One Multi-Cloud Cluster from One Project |
| 156 | +</reference/api-resources-spec/#operation/createOneAdvancedClusterFromOneProject>`. |
| 157 | + |
| 158 | +.. _example-cluster-config-file: |
| 159 | + |
| 160 | +Example Cluster Configuration File |
| 161 | +---------------------------------- |
| 162 | + |
| 163 | +To create a {+cluster+} using a single cloud provider, specify the same |
| 164 | +service provider for your ``regionConfigs`` objects as shown in the |
| 165 | +following example file: |
| 166 | + |
| 167 | +.. literalinclude:: /includes/json-cluster-config-file.json |
| 168 | + |
| 169 | +.. _multi-cloud-example-cluster-config-file: |
| 170 | + |
| 171 | +Multi-Cloud Example Cluster Configuration File |
| 172 | +---------------------------------------------- |
| 173 | + |
| 174 | +To create a multi-cloud {+cluster+}, specify more than one |
| 175 | +service provider for your ``regionConfigs`` objects as shown in the |
| 176 | +following example file: |
| 177 | + |
| 178 | +.. literalinclude:: /includes/json-cluster-config-file-multi.json |
0 commit comments