Navigation

Alpha Release of MongoDB CLI

This is a pre-release early version of MongoDB CLI. Do not use MongoDB CLI to manage production environments.

mongocli atlas cluster update

On this page

The cluster update command modifies your Atlas cluster settings. You can only modify:

  • M10 or larger clusters
  • A single-region replica set

You can also modify a cluster through the Atlas UI or API.

Syntax

mongocli atlas cluster(s) update <cluster-name>
     [ --diskSizeGB <size-of-disk> ]
     [ --file|-f <path-to-cluster-config-file> ]
     [ --instanceSize <cluster-tier> ]
     [ --mdbVersion <mongodb-version> ]
     [ --profile|-p <profile-name> ]
     --projectId <id-of-project>

Note

Use -h or --help to view the command-line help for this command.

Options

Option Type Description Required?
<cluster-name> string Name of your Atlas cluster. You cannot change the name of your cluster. yes
--diskSizeGB int Size of the server’s root volume in GB. You can add capacity by increasing this number. no
--file, -f string

Path to a JSON configuration file that defines cluster settings. Any settings specified in the configuration file take precedence over settings specified by a command option.

For a list of settings you can define, see the Create One Cluster API.

no
--instanceSize string Name of your cluster tier. You can modify your cluster tier. no
--mdbVersion string

Major version of MogoDB to which you want to upgrade your cluster. You cannot downgrade the MongoDB version of your cluster.

Note

Before your upgrade, refer to the current recommended best practices for major version upgrades.

no
--profile, -p string Name of the profile to use for accessing the Atlas project. If omitted, uses the default profile. no
--projectId string Unique identifier of the project containing the cluster you want to update. yes

Output

The command prints the following fields in JSON format to the terminal if the command succeeds. If the command returns errors, see Troubleshooting for recommended solutions.

Field Description
autoScaling Configuration for automatically scaling cluster storage and tier.
autoscaling.diskGBEnabled

Specifies whether or not disk auto-scaling is enabled. Value can be:

  • true if enabled
  • false if diskGBEnabled

By default, disk auto-scaling is disabled.

backupEnabled

Specifies whether or not continuous backups is enabled. Value can be:

  • true if enabled
  • false if disabled
biConnector Configuration for BI Connector for Atlas on the cluster.
biConnector.enabled

Specifies whether or not BI Connector is enabled. Value can be:

  • true if enabled
  • false if disabled

The default value is false.

biConnector.readPreference

Specifies the read preference for BI Connector for Atlas on the cluster. Value can be:

The default value is secondary if there are no analytics nodes in the cluster. If there analytics nodes in the cluster, the default value is analytics.

clusterType

Specifies the type of cluster. Value can be:

  • REPLICASET
  • SHARDED
  • GEOSHARDED

The default value is REPLICASET.

diskSizeGB Specifies the capacity, in GB, of the host’s root volume.
encryptionAtRestProvider Configuration for encryption-at-rest. Default value is NONE.
id Specifies the unique identifier of the cluster.
groupId

Specifies the unique identifier of the project.

Note

Groups and projects are synonymous terms. Your {GROUP-ID} is the same as your project ID.

mongoDBVersion Specifies the MongoDB version that is deployed.
mongoDBMajorVersion Specifies the major version of MongoDB that is deployed.
mongoURI Base connection string for the cluster.
MongoURIUpdated Specifies the timestamp in Timestamp in ISO 8601 date and time format in UTC when the connection string was last updated.
mongoURIWithOptions Specifies the connection string for connecting to the Atlas cluster. Includes the replicaSet, ssl, and authSource query parameters in the connection string with values appropriate for the cluster.
name Specifies the name of the cluster.
numShards

Specifies the numer of shards in the sharded cluster. Value can be:

  • 1 if the cluster is a replica set.
  • 2 or higher, up to 12, if the cluster is a sharded cluster.
paused

Specifies whether or not the cluster is paused. Value can be:

  • true if cluster is paused.
  • false if cluster is active.
providerBackupEnabled

Specifies whether or not Cloud Provider Snapshots is enabled. Value can be:

  • true if enabled.
  • false if disabled.
providerSettings Configuration for the provisioned servers on which MongoDB runs.
providerSettings.diskIOPS Specifies the maximum input/output operations per second (IOPS) that the system can perform. The possible values depend on the selected providerSettings.instanceSizeName and diskSizeGB.
providerSettings.encryptEBSVolume

Specifies whether the Amazon EBS encryption feature encrypts the server’s root volume for both data at rest within the volume and for data moving between the volume and the cluster. Value can be:

  • true if enabled
  • false if disabled
providerSettings.instanceSizeName

Specifies the name of the cluster tier used for Atlas cluster.

Instance Size Default Storage Default RAM
M2 2 GB Shared
M5 5 GB Shared
M10 10 GB 2 GB
M20 20 GB 4 GB
M30 40 GB 8 GB
M40 or R40 80 GB 16 GB
M40_NVME 380 GB 15.25 GB
M50 or R50 160 GB 32 GB
M50_NVME 760 GB 30.5 GB
M60 or R60 320 GB 64 GB
M60_NVME 1.6 TB 61 GB
M80 760 GB 131 GB
R80 750 GB 122 GB
M80_NVME 1.6 TB 122 GB
M100 1 TB 160 GB
M140 1 1 TB 192 GB
M200 or R200 1.5 TB 256 GB
M200_NVME 3.1 TB 244 GB
M300 1 2 TB 384 GB
R300 2 TB 384 GB
R400 3 TB 488 GB
M400_NVME 2 4 TB 512 GB
R700 4 TB 768 GB

1 Unavailable if providerSettings.regionName equals AP_SOUTHEAST_2.

2 Availability limited to the following regions: - US_EAST_1 - US_EAST_2 - US_WEST_2 - EU_WEST_1 - EU_CENTRAL_1 - AP_NORTHEAST_1

Cluster Tiers Default Storage Default RAM
M2 2 GB Shared
M5 5 GB Shared
M10 32 GB 2 GB
M20 32 GB 4 GB
M30 32 GB 8 GB
M40 128 GB 16 GB
M50 128 GB 32 GB
M60 128 GB 64 GB
M80 256 GB 128 GB
M200 256 GB 256 GB
Cluster Tiers Default Storage Default RAM
M2 2 GB Shared
M5 5 GB Shared
M10 10 GB 1.70 GB
M20 20 GB 3.75 GB
M30 40 GB 7.5 GB
M40 80 GB 15 GB
M50 160 GB 30 GB
M60 320 GB 60 GB
M80 750 GB 120 GB
M200 1.5 TB 240 GB
M300 1 2.2 TB 360 GB

1 Unavailable if providerSettings.regionName equals: - SOUTH_AMERICA_EAST_1 - EUROPE_WEST_3 - NORTHEASTERN_ASIA_PACIFIC - AUSTRALIA_SOUTHEAST_1

providerSettings.providerName

Specifies the name of the cloud service provider on which the server is provisioned. Value can be:

  • AWS for Amazon AWS
  • GCP for Google Cloud Platform
  • AZURE for Microsot Azure
providerSettings.regionName

Specifies the physical location of the cluster. For a complete list of regions, see cloud provider reference:

providerSettings.volumeType

Specifies the IOPS range for the selected volume size. Value can be:

  • STANDARD to indicate that providerSettings.diskIOPS value must not exceed the default IOPS rate for the selected volume size.
  • PROVISIONED to indicate that providerSettings.diskIOPS value must fall within the allowable IOPS range for the selected volume size.
replicationFactor Specifies the number of replica set members in the cluster. The possible values are 3, 5, 7.
replicationSpec Configuration for each region in the cluster. Each element in this object represents a region where your cluster is deployed.
replicationSpec.<region>

Specifies the physical location of the region.

Each <region> object describes the region’s priority in elections and the number and type of MongoDB nodes Atlas deploys to the region.

replicationSpec.<region>.analyticsNodes Specifies the number of analytics nodes in the region. Analytics nodes are read-only, and can never become the primary.
replicationSpec.<region>.electableNodes Specifies the number of electable nodes in the region. Electable nodes can become the primary and can facilitate local reads.
replicationSpec.<region>.priority

Specifies the election priority of the region. The highest possible priority is 7, which identifies the Preferred Region of the cluster. Atlas places the primary node in the Preferred Region. The lowest possible priority is 0, which identifies a read-only region.

You can have any number of priority 0 read only regions. Priorities 1 through 7 are exclusive: only one region per cluster can be assigned a given priority.

replicationSpec.<region>.readOnlyNodes Specifies the number of read-only nodes in the region. Read-only nodes can never become the primary member, but can facilitate local reads.
replicationSpecs Configuration for each zone in a Global Cluster. Each object in this array represents a zone where Atlas deploys nodes for your Global Cluster.
replicationSpecs.id Specifies the unique identifier of the replication object.
replicationSpecs.numShards Specifies the number of shards to deploy in the specified zone.
replicationSpecs.zoneName Specifies the name for the zone in a Global Cluster.
replicationSpecs.regionConfig Configuration for the physical location of the region. Each regionsConfig object describes the region’s priority in elections and the number and type of MongoDB nodes that Atlas deploys to the region.
replicationSpecs[n].regionsConfig
.<regionName>.analyticsNodes
Specifies the number of analytics nodes to deploy in the region.
replicationSpecs[n].regionsConfig
.<regionName>.electableNodes``
Number of electable nodes for Atlas to deploy to the region. Electable nodes can become the primary and can facilitate local reads.
replicationSpecs[n].regionsConfig
.<regionName>.priority
Election priority of the region. If you have regions with only read-only nodes, set this value to 0.
replicationSpecs[n].regionsConfig
.<regionName>.readOnlyNodes

Number of read-only nodes for Atlas in the region. Read-only nodes can never become the primary, but can facilitate local-reads.

Specify 0 if you do not want any read-only nodes in the region.

srvAddress The connection string for connecting to the Atlas cluster. The +srv modifier forces the connection to use TLS. The mongoURI parameter lists additional options.
stateName

The current status of the cluster. Value can be:

  • IDLE
  • CREATING
  • UPDATING
  • DELETING
  • DELETED
  • REPAIRING

Examples

Example 1

The following mongocli atlas cluster update command migrates the cluster named sbxCluster in the specified project from M10 to M20. It uses the default profile for accessing the project.

mongocli atlas cluster update sbxCluster --projectId 5e2211c17a3e5a48f5497de3 --instanceSize M20

The command prints the following fields to the terminal:

{
     "autoScaling": {
             "diskGBEnabled": true
     },
     "backupEnabled": false,
     "biConnector": {
             "enabled": false,
             "readPreference": "secondary"
     },
     "clusterType": "REPLICASET",
     "diskSizeGB": 2,
     "encryptionAtRestProvider": "NONE",
     "id": "5e2f1f657a3e5a052beddd92",
     "groupId": "5e2211c17a3e5a48f5497de3",
     "mongoDBVersion": "4.2.3",
     "mongoDBMajorVersion": "4.2",
     "mongoURI": "mongodb://sbxcluster-shard-00-00-7hgjn.mongodb-dev.net:27017,sbxcluster-shard-00-01-7hgjn.mongodb-dev.net:27017,sbxcluster-shard-00-02-7hgjn.mongodb-dev.net:27017",
     "mongoURIUpdated": "2020-01-27T17:41:49Z",
     "mongoURIWithOptions": "mongodb://sbxcluster-shard-00-00-7hgjn.mongodb-dev.net:27017,sbxcluster-shard-00-01-7hgjn.mongodb-dev.net:27017,sbxcluster-shard-00-02-7hgjn.mongodb-dev.net:27017/?ssl=true\u0026authSource=admin\u0026replicaSet=sbxCluster-shard-0",
     "name": "sbxCluster",
     "numShards": 1,
     "paused": false,
     "providerBackupEnabled": false,
     "providerSettings": {
             "diskIOPS": 100,
             "encryptEBSVolume": true,
             "instanceSizeName": "M20",
             "providerName": "AWS",
             "regionName": "US_EAST_1",
             "volumeType": "STANDARD"
     },
     "replicationFactor": 3,
     "replicationSpec": {
             "US_EAST_1": {
                     "analyticsNodes": 0,
                     "electableNodes": 3,
                     "priority": 7,
                     "readOnlyNodes": 0
             }
     },
     "replicationSpecs": [
             {
                     "id": "5e2f1f657a3e5a052beddd8d",
                     "numShards": 1,
                     "zoneName": "Zone 1",
                     "regionsConfig": {
                             "US_EAST_1": {
                                     "analyticsNodes": 0,
                                     "electableNodes": 3,
                                     "priority": 7,
                                     "readOnlyNodes": 0
                             }
                     }
             }
     ],
       "srvAddress": "mongodb+srv://sbxcluster-7hgjn.mongodb-dev.net",
       "stateName": "UPDATING"
}

Example 2

The following mongocli atlas cluster update command uses a configuration file to:

  • Increase the cluster tier from M10 to M20 and
  • Increase the server’s root volume to 200 GB.

The command uses the profile named egAtlasProfile, which contains the public and private keys for accessing Atlas.

mongocli atlas cluster update myCluster --file cluster-config.json --projectId 5e2211c17a3e5a48f5497de3 --profile egAtlasProfile

The cluster configuration file contains the updated settings:

{
 "diskSizeGB": 200,
 "providerSettings": {
     "providerName": "AWS",
     "diskIOPS": 100,
     "instanceSizeName": "M20"
 },
 "replicationFactor": 3
}

The command prints the following to the terminal. To learn more about these fields, see Output.

{
 "autoScaling": {
  "diskGBEnabled": true
 },
 "backupEnabled": false,
 "biConnector": {
  "enabled": false,
  "readPreference": "secondary"
 },
 "clusterType": "REPLICASET",
 "diskSizeGB": 120,
 "encryptionAtRestProvider": "NONE",
 "id": "5e66718ec4121d0a54021794",
 "groupId": "5e2f04ecf10fab66c7d4072e",
 "mongoDBVersion": "4.2.3",
 "mongoDBMajorVersion": "4.2",
 "mongoURI": "mongodb://cluster0-shard-00-00-xgwul.mongodb-dev.net:27017,cluster0-shard-00-01-xgwul.mongodb-dev.net:27017,cluster0-shard-00-02-xgwul.mongodb-dev.net:27017",
 "mongoURIUpdated": "2020-03-09T16:47:50Z",
 "mongoURIWithOptions": "mongodb://cluster0-shard-00-00-xgwul.mongodb-dev.net:27017,cluster0-shard-00-01-xgwul.mongodb-dev.net:27017,cluster0-shard-00-02-xgwul.mongodb-dev.net:27017/?ssl=true\u0026authSource=admin\u0026replicaSet=Cluster0-shard-0",
 "name": "Cluster0",
 "numShards": 1,
 "paused": false,
 "providerBackupEnabled": true,
 "providerSettings": {
  "diskIOPS": 360,
  "encryptEBSVolume": true,
  "instanceSizeName": "M10",
  "providerName": "AWS",
  "regionName": "US_EAST_1",
  "volumeType": "STANDARD"
 },
 "replicationFactor": 3,
 "replicationSpec": {
  "US_EAST_1": {
   "analyticsNodes": 0,
   "electableNodes": 3,
   "priority": 7,
   "readOnlyNodes": 0
  }
 },
 "replicationSpecs": [
  {
   "id": "5e667185746809055da6b383",
   "numShards": 1,
   "zoneName": "Zone 1",
   "regionsConfig": {
    "US_EAST_1": {
     "analyticsNodes": 0,
     "electableNodes": 3,
     "priority": 7,
     "readOnlyNodes": 0
    }
   }
  }
 ],
 "srvAddress": "mongodb+srv://cluster0-xgwul.mongodb-dev.net",
 "stateName": "UPDATING"
}