After you create PolarDB clusters, you can manually add or remove read-only nodes to or from the clusters.

Background information

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

Billing methods of new nodes

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

Considerations

  • You can add or remove read-only nodes only when the cluster does not have pending configuration changes.
  • To avoid misoperations, you can add or remove only one read-only node at a time. To add or remove multiple read-only nodes, you must repeat the operation for multiple times.
  • It takes about 5 minutes to add or remove a node.

Add a read-only node

Note A read/write splitting connection that is created after a read-only node is added forwards requests to the read-only node. A read/write splitting connection that is created before a read-only node is added does not forward requests to the read-only node. You must close the current connection and establish the connection again. For example, you can restart the 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 resides.
  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 to add a read-only node. Read and agree to the service agreement. To agree to the service agreement, select the check box. Then, click Buy Now and complete the payment.

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 resides.
  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 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.