This topic describes how to manually add or remove read-only nodes after you create a PolarDB cluster.

Prerequisites

  • Only PolarDB for MySQL Cluster Edition is supported. Single Node and Archive Database are not supported. For more information about the three editions of PolarDB for MySQL, see Overview.
  • No tasks for specification changes for your PolarDB cluster are in the pending state.

Background information

A PolarDB cluster of Cluster Edition can contain at most 15 read-only nodes. Each cluster must contain at least one read-only node to ensure high availability. All nodes in a cluster use the same specifications.

Billing rules

You are charged for newly added nodes based on the following billing rules:

  • If you add a node to a subscription cluster, the node is billed on a subscription basis.
  • If you add a node to a pay-as-you-go cluster, the node is billed on a pay-as-you-go basis.
Note
  • You can release read-only nodes that use the subscription and pay-as-you-go methods as needed. After you release a node, the system refunds fees for the remaining subscription period or stops billing. For more information, see Configuration change fees.
  • The nodes that you add are billed based on the node specifications. For more information, see Billable items. The storage fee varies based on the used storage space, regardless of the number of nodes.

Impacts of node quantity on cluster performance

For more information, see OLTP performance tests.

Precautions

  • You can add multiple read-only nodes at a time only to PolarDB for MySQL clusters. Each cluster can contain at most 15 read-only nodes.
  • You can remove multiple read-only nodes at a time only from PolarDB for MySQL clusters. However, you must keep at least one read-only node in the cluster to ensure high availability.
  • It requires about 5 minutes to add a read-only node. The time consumption varies based on multiple factors, such as the number of nodes that are added, the numbers of tables and databases, and the database loads. When PolarDB adds nodes to a cluster, the databases in the cluster are not affected.
  • When PolarDB removes a read-only node from a cluster, connections to the node are closed. The connections to other nodes in the cluster are not affected. We recommend that you remove nodes during off-peak hours and make sure that your applications are configured with the automatic reconnection mechanism. If you remove a node from a PolarDB cluster and your application is connected to the cluster endpoint, the removed node is transparent to the application. Therefore, you do not need to modify the configurations of the application.

Add a read-only node

Note After you add a read-only node, a read session is established to forward read requests to the read-only node. However, existing read sessions are not redirected to the read-only node. To resolve this issue, you can close and recreate these sessions by restarting your applications. Then, sessions are established to the newly added node.
  1. Log on to the PolarDB console.
  2. In the upper-left corner of the console, select the region where the cluster that you want to manage is deployed.
  3. Open the Add/Remove Node dialog box by using one of the following methods:
    • Open the Add/Remove Node dialog box from the Clusters page.

      Find the cluster that you want to manage and click Add/Remove Node in the Actions column.

      Cluster list
    • Open the Add/Remove Node dialog box from the Overview page of the cluster.
      1. Find the cluster that you want to manage and click the cluster ID. The Overview page appears.
      2. In the Database Nodes section, click the 1 icon to change the display mode.
      3. Click Add/Remove Node.
      Basic information
  4. Select Add Node and click OK.
    Add/Remove Node
  5. Click + Add a read-only node, specify Switching Time, read and accept the terms of service, and then click Buy Now.
    Note
    • If you want to add multiple nodes to your PolarDB for MySQL cluster at a time, click + Add a read-only node again to add more nodes.
    • You can set Switching Time to Switch Now or Switch At. If you select Switch At, you can specify a point in time within the following 24 hours. The nodes will be added within 30 minutes after the specified point in time. You can view the details about the scheduled task on the Scheduled Tasks page, or cancel the task. For more information, see View or cancel a scheduled task.
  6. On the Purchase page, confirm the order information and click Purchase.

Remove a read-only node

  1. Log on to the PolarDB console.
  2. In the upper-left corner of the console, select the region where the cluster that you want to manage is deployed.
  3. Open the Add/Remove Node dialog box by using one of the following methods:
    • Open the Add/Remove Node dialog box from the Clusters page.

      Find the cluster that you want to manage and click Add/Remove Node in the Actions column.

      Cluster list
    • Open the Add/Remove Node dialog box from the Overview page of the cluster.
      1. Find the cluster that you want to manage and click the cluster ID. The Overview page appears.
      2. In the Database Nodes section, click the 1 icon to change the display mode.
      3. Click Add/Remove Node.
      Basic information
  4. Select Remove Node and click OK.
    1
  5. Click the Minus sign (-) icon icon to the left of a node name to remove the node.
    Note You can remove multiple read-only nodes at a time only from PolarDB for MySQL clusters. However, you must keep at least one read-only node in the cluster to ensure high availability.
  6. Read and accept the terms of service and click Buy Now.
    Note After a node is removed, the system refunds fees for the remaining subscription period or stops billing. For more information, see Configuration change fees.

Related API operations

API Description
CreateDBNodes Adds read-only nodes to a PolarDB cluster.
ModifyDBNodeClass Changes the node specifications of a PolarDB cluster.
RestartDBNode Restarts a specified node in a PolarDB cluster.
DeleteDBNodes Removes read-only nodes from a PolarDB cluster.