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 Specifications and pricing. 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. On the top of the page, select the region where the target cluster is located.
  3. Go to the Add/Remove Node dialog box by using the following two methods:
    • Go to the Add/Remove Node dialog box from the Clusters page.

      Find the cluster to which you want to add a node. Click Add/Remove Node in the Actions column.

      Clusters
    • Go to the Add/Remove Node dialog box from the Overview page of the cluster.
      • Find the cluster to which you want to add a node 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 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. On the top of the page, select the region where the target cluster is located.
  3. Go to the Add/Remove Node dialog box by using the following two methods:
    • Go to the Add/Remove Node dialog box from the Clusters page.

      Find the cluster from which you want to remove a node. Then, click Add/Remove Node in the Actions column for the cluster.

      Clusters
    • Go to the Add/Remove Node dialog box from the Overview page of the cluster.
      • Find the cluster from which you want to remove a node 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 be removed.
    Note You must retain at least one read-only node in the cluster to ensure high availability.
  6. Read the service agreement, select the check box, and then click Buy Now.
    Note After a node is removed, the system provides refunds for the remaining subscription periods or stops billing. For more information, see Configuration change fees.

Related API operations

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