Docs Menu
Docs Home
/ /
MongoDB Command Line Interface
/ / /

mongocli ops-manager cluster update

On this page

  • Syntax
  • Options
  • Output
  • Examples

The cluster update command updates a cluster in the specified Ops Manager project. You can also update a cluster through the Ops Manager UI or 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.

mongocli ops-manager|om cluster update \
--file|-f <om-settings-file>
[ --output|-o <output-format> ]
[ --profile|-P <profile-name> ]
[ --projectId <project-ID> ]

Note

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

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
--output, -o
string

Command output format. Valid values are:

  • json for output in JSON format

  • go-template for custom output using the Go template

  • go-template-file for custom output specified using Go template file

If omitted, the command returns output in the default format.

no
--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. If omitted, uses the project ID in the profile or environment variable.

no

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://<hostname>:<port>/v2/<projectId>#deployment/topology for status

where:

  • <hostname>:<port> is the Ops Manager base URL

  • projectId is the unique identifier of the project

The following examples show two ways to run the command.

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

mongocli ops-manager cluster update \
--file om-cluster.yaml \
--projectId {PROJECT-ID}

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

  • A file named om-cluster.json

  • A custom profile named egOMprofile

mongocli om cluster update \
--file om-cluster.json \
--projectId {PROJECT-ID} \
--profile egOMprofile

The Example 1 and Example 2 commands print the following to the terminal:

Changes are being applied, please check http://localhost:30700/v2/{PROJECT-ID}#deployment/topology for status

Back

Create a Cluster