You can manually add or remove read-only nodes after you create a PolarDB cluster.

Background

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

Billing methods of nodes

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

  • If a node is added to a subscription cluster, you are charged based on the subscription billing method.
  • If a node is added to a pay-as-you-go cluster, you are charged based on the pay-as-you-go billing method.
Note
  • You can release subscription or pay-as-you-go read-only nodes based on your business requirements. After you release a node, the system refunds fees for the remaining subscription period or stops billing. For more information, see Configuration change fees.
  • Only the specifications of the added nodes are charged. For more information, see Billable items. The storage fee is charged based on the used storage, regardless of the number of nodes.

Impact of the node quantity on performance

For more information, see OLTP performance tests.

Considerations

  • You can add or remove read-only nodes only when the cluster does not have pending specification changes.
  • Only ApsaraDB PolarDB MySQL-compatible edition clusters allow you to add multiple read-only nodes at a time. You can add up to 15 read-only nodes to a cluster.
  • Only ApsaraDB PolarDB MySQL-compatible edition clusters allow you to remove multiple read-only nodes at a time. However, you must keep at least one read-only node in the cluster to ensure high availability.
  • It requires about 5 to 10 minutes to add a node. The consumed time depends on the factors such as the number of new nodes, the number of tables, and the loads of the database.
  • You may experience PolarDB service interruptions for a few seconds during specification changes. During this time, you cannot perform some operations. We recommend that you change specifications during off-peak hours and make sure that your applications can automatically reconnect to the cluster.

Add a read-only node

Note After you add a read-only node, the read requests of new read/write splitting sessions are forwarded to the read-only node. The read requests of read/write splitting sessions that are created before you add a read-only node are not forwarded to the newly added read-only node. To forward these read requests to the added read-only node, you must close the connection and reconnect to the cluster. For example, you can restart your application to establish the connection.
  1. Log on to the PolarDB console.
  2. In the upper-left corner of the console, select the region where the cluster is deployed.
  3. Open the Add/Remove Node dialog box by using the following methods:
    • Open the Add/Remove Node dialog box from the Clusters page.

      Find the cluster and click Add/Remove Node in the Actions column.

      Clusters
    • Open the Add/Remove Node dialog box from the Overview page of the cluster.
      1. Find the cluster 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.
      Overview
  4. Select Add Node and click OK.
    Add/Remove Node
  5. Click Add a read-only node, specify Switching Time, and then read and accept the terms of service. Click Buy Now.
    Note
    • If you need to add multiple nodes to your ApsaraDB PolarDB MySQL-compatible edition cluster at a time, click + Add a read-only node to add nodes one after another.
    • You can set Switching Time to Switch Now or Switch At. If you select Switch At, you can specify a point in time within 24 hours. It requires about 30 minutes to upgrade the cluster from the specified point in time.
    • You may experience PolarDB service interruptions for a few seconds during specification changes. During this time, you cannot perform some operations. We recommend that you change specifications during off-peak hours and make sure that your applications can automatically reconnect to the cluster.
  6. On the Purchase page, confirm the unpaid order and click Purchase.

Remove read-only nodes

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

      Find the cluster and click Add/Remove Node in the Actions column.

      Clusters
    • Open the Add/Remove Node dialog box from the Overview page of the cluster.
      • Find the cluster and click the cluster ID. The Overview page appears.
      • In the Database Nodes section, click the 1 icon to change the display mode.
      • Click Add/Remove Node.
      Overview
  4. Select Remove Node and click OK.
    1
  5. Click the Minus sign (-) icon icon in front of the name of the node to remove the node.
    Note
    • Only ApsaraDB PolarDB MySQL-compatible edition clusters allow you to remove multiple read-only nodes at a time. However, you must keep at least one read-only node in the cluster to ensure high availability.
    • You may experience PolarDB service interruptions for a few seconds during specification changes. During this time, you cannot perform some operations. We recommend that you change specifications during off-peak hours and make sure that your applications can automatically reconnect to the cluster.
  6. Read and accept the terms of service, and then click Buy Now.
    Note After a node is removed, the system refunds fees for the remaining subscription periods or stops billing. For more information, see Configuration change fees.

Related API operations

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