Yandex.Cloud
  • Services
  • Why Yandex.Cloud
  • Solutions
  • Pricing
  • Documentation
  • Contact us
Get started
Yandex Managed Service for MongoDB
  • Getting started
  • Step-by-step instructions
    • All instructions
    • Information about existing clusters
    • Creating clusters
    • Database migration to Yandex.Cloud
    • Connecting to databases
    • Stopping and starting clusters
    • Changing cluster and database settings
    • MongoDB version upgrade
    • Database management
    • Managing hosts in a cluster
    • Managing database users
    • Managing backups
    • Managing shards
    • Deleting clusters
  • Solutions
    • Sharding collections
  • Concepts
    • Relationship between service resources
    • Host classes
      • Active host classes
      • Archive
        • Before June 1, 2020
      • Using deprecated host classes
    • Network in Yandex Managed Service for MongoDB
    • Quotas and limits
    • Storage types
    • Backups
    • Replication
    • Sharding
    • Users and roles
    • Supported clients
  • Access management
  • Pricing policy
    • Current pricing policy
    • Archive
      • Before January 1, 2019
      • From January 1 to March 1, 2019
      • From March 1, 2019 to February 1, 2020
  • API reference
    • Authentication in the API
    • gRPC
      • Обзор
      • BackupService
      • ClusterService
      • DatabaseService
      • ResourcePresetService
      • UserService
      • OperationService
    • REST
      • Overview
      • Backup
        • Overview
        • get
        • list
      • Cluster
        • Overview
        • addHosts
        • addShard
        • backup
        • create
        • delete
        • deleteHosts
        • deleteShard
        • enableSharding
        • get
        • getShard
        • list
        • listBackups
        • listHosts
        • listLogs
        • listOperations
        • listShards
        • move
        • rescheduleMaintenance
        • resetupHosts
        • restartHosts
        • restore
        • start
        • stop
        • streamLogs
        • update
      • Database
        • Overview
        • create
        • delete
        • get
        • list
      • ResourcePreset
        • Overview
        • get
        • list
      • User
        • Overview
        • create
        • delete
        • get
        • grantPermission
        • list
        • revokePermission
        • update
      • Operation
        • Overview
        • get
  • Questions and answers
    • General questions
    • Questions about MongoDB
    • All questions on the same page
  1. Step-by-step instructions
  2. Changing cluster and database settings

Changing cluster settings

  • Change the host class
  • Increasing storage size
  • Changing MongoDB settings
  • Changing additional cluster settings

After creating a cluster, you can:

  • Change the host class.

  • Increase the storage size (available only for network storage, network-hdd, and network-ssd).

  • Configure MongoDB servers according to the MongoDB documentation.

  • Change additional cluster settings.

Change the host class

Management console
CLI
API
  1. Go to the folder page and select Managed Service for MongoDB.
  2. Select the cluster and click Edit cluster in the top panel.
  3. To change the class of MongoDB hosts, under Host class, select the required class.
  4. Click Save changes.

If you don't have the Yandex.Cloud command line interface yet, install and initialize it.

The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name or --folder-id parameter.

To change the host class for the cluster:

  1. View a description of the CLI's update cluster command:

    $ yc managed-mongodb cluster update --help
    
  2. Request a list of available host classes (the ZONES column specifies the availability zones where you can select the appropriate class):

    $ yc managed-mongodb resource-preset list
    
    +-----------+--------------------------------+-------+----------+
    |    ID     |            ZONE IDS            | CORES |  MEMORY  |
    +-----------+--------------------------------+-------+----------+
    | s1.micro  | ru-central1-a, ru-central1-b,  |     2 | 8.0 GB   |
    |           | ru-central1-c                  |       |          |
    | ...                                                           |
    +-----------+--------------------------------+-------+----------+
    
  3. Specify the class in the update cluster command:

    $ yc managed-mongodb cluster update <cluster name>
         --mongod-resource-preset <class ID>
    

    Managed Service for MongoDB will run the update host class command for the cluster.

You can change the cluster host class using the API's update method: pass the appropriate values in the request parameter configSpec.mongodbSpec_3_64_2.mongod.configresources.resourcePresetId.

To request a list of supported values, use the list method for the ResourcePreset resources.

Increasing storage size

Management console
CLI
API
  1. Go to the folder page and select Managed Service for MongoDB.
  2. Select the cluster and click Edit cluster in the top panel.
  3. Under Storage size, specify the required value.
  4. Click Save changes.

If you don't have the Yandex.Cloud command line interface yet, install and initialize it.

The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name or --folder-id parameter.

To increase the storage size for a cluster:

  1. View a description of the CLI's update cluster command:

    $ yc managed-mongodb cluster update --help
    
  2. Make sure the cloud's quota is sufficient to increase the storage size: open the Quotas page for your cloud and check that the Yandex Managed Service for MongoDB section still has space available in the space line.

  3. Make sure the required cluster is using network storage (it is not yet possible to increase the size of local storage). To do this, request information about the cluster and find the disk_type_id field: it should be set to network-hdd or network-ssd:

    $ yc managed-mongodb cluster get <cluster name>
    
    id: c7qkvr3u78qiopj3u4k2
    folder_id: b1g0ftj57rrjk9thribv
    ...
    config:
      mongodb_4_4:
        mongod:
          config:
            user_config: {}
          resources:
            resource_preset_id: s1.micro
            disk_size: "21474836480"
            disk_type_id: network-ssd
    ...
    
  4. Specify the required amount of storage in the update cluster command (it must be at least as large as disk_size in the cluster properties):

    $ yc managed-mongodb cluster update <cluster name>
         --mongod-disk-size <storage size in GB>
    

    If all these conditions are met, Managed Service for MongoDB launches the operation to increase storage space.

You can change the storage size for a cluster using the API update method: pass the appropriate values in the request parameter configSpec.mongodbSpec_4_2.mongod.resources.diskSize.

Make sure the cloud's quota is sufficient to increase the storage size: open the Quotas page for your cloud and check that the Yandex Managed Service for MongoDB section still has space available in the space line.

Changing MongoDB settings

You can change the DBMS settings of the hosts in your cluster. All supported settings are described in the API reference.

Management console
CLI
API
  1. Go to the folder page and select Managed Service for MongoDB.

  2. Click the name of the cluster, then click Edit cluster.

  3. Under DBMS settings, click Settings.

  4. Edit the DBMS parameters, then click Save in the dialog window and Save changes in the Management console.

Once you edit the DBMS parameters, the cluster's state changes to UPDATING. If the edited parameters can only be applied on DBMS restart, Managed Service for MongoDB sequentially restarts the DBMS on all the cluster hosts.

If you don't have the Yandex.Cloud command line interface yet, install and initialize it.

The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name or --folder-id parameter.

To change the DBMS settings for a cluster, use the command:

$ yc managed-mongodb cluster update-config

For example, to set net.maxIncomingConnections to 4096, run the following command:

$ yc managed-mongodb cluster update-config <cluster name>
    --set net.max_incoming_connections=4096

Managed Service for MongoDB will run the update DBMS settings command for the cluster. If the setting being changed is only applied when the database is restarted, Managed Service for MongoDB sequentially restarts the database on all the cluster hosts.

You can update DBMS settings for a cluster using the API update method: pass the appropriate values in the request parameter configSpec.mongodbSpec_4_2.mongod.config.

Changing additional cluster settings

Management console
CLI
  1. Go to the folder page and select Managed Service for MongoDB.

  2. Select the cluster and click Edit cluster in the top panel.

  3. Change additional cluster settings:

    • Backup start (UTC): The time in UTC when you want to start creating a backup of a cluster (in 24-hour format). If the time is not set, the backup will start at 22:00 UTC.

    • Retention period for automatic backups, days: The time to retain the automatically created backups. If an automatic backup expires, it is deleted. The default is 7 days. This feature is at the Preview stage. For more information, see Backups.

      Changing the retention period affects both new automatic backups and existing backups: when you increase/decrease the retention period, the lifetime for existing backups increases/decreases.

      For example, if the original retention period was 7 days and the remaining lifetime of a separate automatic backup is 1 day, then when the retention period increases to 9 days, the remaining lifetime of this backup becomes 3 days.

    • Maintenance window: Settings of the technical support window. You can use the settings to specify the preferred start time for cluster host maintenance (for example, you can select the time when the cluster is least loaded with requests):

      • To specify the preferred start time for the maintenance window, select by schedule and set the desired day of the week and hour of day in UTC (Coordinated Universal Time) using the drop-down lists.
      • To allow maintenance at any time, select arbitrary.

      Maintenance may include updating the DBMS version, applying patches, and so on.

  4. Click Save changes.

If you don't have the Yandex.Cloud command line interface yet, install and initialize it.

The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name or --folder-id parameter.

Change additional cluster settings:

  • To set the backup start time, run the following command:

    $ yc managed-mongodb cluster update "<cluster name>" --backup-window-start="<time>"
    

    Time is specified in UTC format HH:MM:SS. If the time is not set, the backup will start at 22:00 UTC.

  • To set the retention period for automatic backups (in days), run the following command:

    $ yc managed-mongodb cluster update "<cluster name>" --backup-retain-period-days="<retention period>"
    

    The parameter --backup-retain-period-days must be in the range from 7 to 35 (default value is 7). If an automatic backup expires, it is deleted. This feature is at the Preview stage. For more information, see Backups.

    Changing the retention period affects both new automatic backups and existing backups: when you increase/decrease the retention period, the lifetime for existing backups increases/decreases.

    For example, if the original retention period was 7 days and the remaining lifetime of a separate automatic backup is 1 day, then when the retention period increases to 9 days, the remaining lifetime of this backup becomes 3 days.

You can get the cluster name with a list of clusters in the folder.

In this article:
  • Change the host class
  • Increasing storage size
  • Changing MongoDB settings
  • Changing additional cluster settings
Language / Region
Careers
Privacy policy
Terms of use
Brandbook
© 2021 Yandex.Cloud LLC