Updated on 2024-08-08 GMT+08:00

Restarting an Instance or a Node

You may need to occasionally restart an instance to perform routine maintenance. For example, after modifying certain parameters, the instance may need to be restarted to apply the changes.

Precautions

  • You can restart an instance only when its status is Available.
  • Restarting an instance will interrupt services. Exercise caution when performing this operation.
  • This instance is not available when it is being restarted. Restarting an instance will clear the cached memory in it. You are advised to restart it during off-peak hours.
  • If you restart a cluster or replica set instance, all nodes in the instance are also restarted.
  • You can restart a cluster instance or any dds mongos, shard, config node, or read replica in the cluster instance. During the restart, the node cannot be accessed.
  • You can restart a replica set instance. During the restart, the instance cannot be accessed.
  • You can restart any read replica in a replica set instance. During the restart, the node cannot be accessed.

    Only whitelisted users can restart a read replica in a replica set instance. You need to submit a service ticket to apply for this function. In the upper right corner of the management console, choose Service Tickets > Create Service Ticket to submit a service ticket.

  • You can forcibly restart an abnormal node in a DB instance. The node cannot be accessed during the restart.
  • After a replica set instance is restarted, the node roles may change.
  • It takes less than 30 seconds to start a mongod or dds mongos process. If there are a large number of collections (more than 10,000), it may take several minutes to start the Mongod process. Before the startup is complete, the corresponding node cannot be connected. You are advised to limit the number of collections to less than 10,000 to avoid excessive service loss due to long-time startup.
  • If you enable operation protection to improve the security of your account and cloud products, two-factor authentication is required for sensitive operations. For details about how to enable operation protection, see Operation Protection in Identity and Access Management User Guide.

Restarting an Instance

  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 instance and in the Operation column, choose More > Restart.

    Figure 1 Restarting an instance

    Alternatively, click the instance name and on the displayed Basic Information page, click Restart in the upper right corner of the page.

    Figure 2 Restarting an instance

  5. If you have enabled operation protection, click Start Verification in the Restart DB Instance dialog box. On the displayed page, click Send Code, enter the verification code, and click Verify. The page is closed automatically.
  6. In the displayed dialog box, click Yes.
  7. View the instance status.

    On the Instances page, the instance status is Restarting.

Restarting a Cluster Node

  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, click the cluster instance name.
  5. In the Node Information area on the Basic Information page, click the dds mongos, shard, or config tab, locate a node, and in the Operation column, click Restart.

    Figure 3 Restarting a dds mongos node

  6. In the displayed dialog box, click Yes.
  7. View the node status.

    When one node status is Restarting, other nodes of the instance cannot be restarted.

Restarting a Read Replica of a Replica Set Instance

  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, click the replica set instance.
  5. In the Node Information area on the Basic Information page, click the Read replicas tab, locate the read replica to be restarted, and click More in the Operation column.

    Figure 4 Read replicas

  6. Select Restart.
  7. In the displayed dialog box, click Yes to restart the read replica.
  8. View the status of the read replica.

    When one node status is Restarting, other nodes of the instance cannot be restarted.

Forcibly Restarting an Abnormal Node

  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 target DB instance and click its name.
  5. In the Node Information area on the Basic Information page, click Forcibly Restart in the Operation column of the target abnormal node.

    Figure 5 Selecting an abnormal node

  6. In the displayed dialog box, click Yes to restart the abnormal node.

    Figure 6 Restarting the abnormal node

  7. View the status of the node.

    When one node status is Restarting, other nodes of the instance cannot be restarted.

Restarting Nodes in a Replica Set Instance One by One

  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 in the Operation column, choose More > Restart.

    Figure 7 Restarting a replica set instance

    Alternatively, click the replica set instance name and on the displayed Basic Information page, click Restart in the upper right corner of the page.

    Figure 8 Restarting a replica set instance

  5. In the displayed dialog box, select Restart nodes one by one.
  6. Click Yes to restart the replica set instance nodes one by one.
  7. Check the DB instance status.

    On the Instances page, the instance status is Restarting. If nodes in a replica set instance are restarted one by one, a primary/secondary switchover is triggered.