Updated on 2023-03-15 GMT+08:00

Changing a Replica Set Instance Class

This section describes how to change the class of a replica set instance.

Change Rules

Table 1 lists the specifications to which each instance specification can be changed. Exercise caution when performing this operation. Once the instance specification is changed, it cannot be changed back again.

Table 1 Change rules

Original Specification

Target Specification

Supported

General-purpose

General-purpose

Enhanced

×

Enhanced II

Enhanced

General-purpose

Enhanced

×

Enhanced II

Enhanced II

General-purpose

×

Enhanced

×

Enhanced II

√ indicates that an item is supported, and × indicates that an item is not supported.

Precautions

  • A DB instance cannot be deleted while its instance class is being changed.
  • When the CPU or memory of a replica set instance is changed, the read replica class is not changed.
  • When the instance class is being changed, a primary/secondary switchover may occur once or twice and the database connection will be interrupted each time for up to 30s. You are advised to change the specifications during off-peak hours to reduce impacts and ensure that the service system of your client can reconnect to the database if the connection is interrupted.
  • After the class of a replica set instance is changed, the system will change the value of net.maxIncomingConnections accordingly.

Pre-check Items for Instance Class Change

  • The instance status and the status of the node whose specifications are to be changed are normal.
  • The primary/standby replication delay does not exceed 20s.

Billing

  • Instances in pay-per-use mode are still charged based on the time used after the instance class is changed.
  • If you change the class of a yearly/monthly instance, you will either pay for the difference or receive a refund.
    • If the price of the new instance class is higher than that of the original instance class, you need to pay for the price difference based on the used resource period.
    • If the price of the new instance class is lower than that of the original instance class, you will be refunded the difference based on the used resource period. The refund will be sent to your account. You can click Billing Center in the upper right corner of the console to view your account balance.

Procedure

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and a project.
  3. Click in the upper left corner of the page and choose Databases > Document Database Service.
  4. On the Instances page, locate the replica set instance and choose More > Change Instance Class in the Operation column.

    Figure 1 Change Instance Class

    Alternatively, on the Instances page, click the name of the replica set instance. In the DB Information area on the Basic Information page, click Change to the right of the Node Class field.

    Figure 2 Change

  5. On the displayed page, select the required specifications and new instance class and click Next.

    The time required depends on the number of instance nodes whose specifications are to be changed. It takes about 5 to 10 minutes for each node. When the instance class is being changed, a primary/secondary switchover may occur once or twice and the database connection will be interrupted each time for up to 30s. Before the specification change, learn about Pre-check Items for Instance Class Change. You are advised to change the specifications during off-peak hours to reduce impacts and ensure that the service system of your client can reconnect to the database if the connection is interrupted.

    Figure 3 Change Instance Class

  6. On the displayed page, confirm the instance class.

    • If you need to modify your settings, click Previous.
    • For pay-per-use instances

      If you do not need to modify your settings, click Submit to change the instance class. After the specifications are changed, you are still charged on an hourly basis.

    • For yearly/monthly instances
      • If you intend to scale down the instance class, click Submit. The refund is automatically returned to your account.
      • If you intend to scale up the DB instance class, click Pay Now. The scaling starts only after the payment is successful.

  7. View the results.

    • When the instance class is being changed, the status displayed in the Status column is Changing instance class. This process takes about 25 to 30 minutes.

      High database load increases the specification change duration. You are advised to change the specifications during off-peak hours to reduce impacts.

    • In the upper right corner of the instance list, click to refresh the list. The instance status changes to Available.
    • Go to the Basic Information page of the replica set instance you scaled up and check whether the scaling up is successful in the DB Information area.