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 cloud-manager cluster update

On this page

The cluster update command updates the cluster in the specified MongoDB Cloud Manager project. You can also update a cluster through the Cloud Manager UI or the Automation Configuration API.

Using the cluster update command, you can add new members to the replica set, replace or remove a member, and modify the priority of a member or the number of votes for a member during an election. You cannot modify the port number or file paths of the mongod processes.

Syntax

mongocli cloud-manager|cm cluster update
     --file|-f <cm-settings-file>
     [ --profile|-p <profile-name> ]
     [ --projectId <project-ID> ]

Note

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

Options

Option Type Description Required?
--file, -f string Path to the file that contains the modified settings. To learn more about the format and the configuration properties to specify in the configuration file, see Cluster Configuration File. yes
--profile, -p string Name of the profile where the public and private keys for the project are saved. If omitted, uses the default profile. To learn more about creating a profile, see Configure the MongoDB CLI. no
--projectId string Unique identifier of the project that contains the cluster to update. If omitted, uses the project ID in the profile or the environment variable. no

Output

The command prints output similar to the following to the terminal if the command succeeds. If the command returns errors, see Troubleshooting for recommended solutions.

Changes are being applied, please check http://cloud.mongodb.com/v2/<projectId>#deployment/topology for status

where projectId is the unique identifier of the project.

Examples

The following examples show two ways to run the command.

Example 1

The following mongocli cloud-manager cluster update command updates the cluster named myCluster in the specified project using:

  • A file named cm-cluster.yaml
  • A custom profile named egCMprofile
~ mongocli cloud-manager cluster update --file cm-cluster.yaml --projectId 5e2f06127a3e5a5700de8d8d --profile egCMprofile

Example 2

The following mongocli cm cluster update command updates the cluster named myCluster in the specified project using:

  • A file named cm-cluster.json
  • The default profile
~ mongocli cm cluster update --file cm-cluster.json --projectId 5e2f06127a3e5a5700de8d8d

Output

The Example 1 and Example 2 commands print the following to the terminal. To learn more about these fields, see Output.

Changes are being applied, please check https://cloud.mongodb.com/v2/5e2f06127a3e5a5700de8d8d#deployment/topology for status