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

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 nodes in a cluster have the same specifications.

Billing methods of nodes

The following billing methods are used for the nodes that are added to an existing cluster:
  • If nodes are added to a subscription cluster, you are billed for the nodes based on the subscription billing method.
  • If nodes are added to a pay-as-you-go cluster, you are billed for the nodes based on the pay-as-you-go billing method.
Note
  • You can release read-only nodes that are billed based on the two methods. After you release read-only nodes, the system provides refunds for the remaining subscription periods or stops billing. For more information, see Configuration change fees.
  • The added nodes are charged based on the node specifications. For more information, see Specifications and pricing. The storage fee is charged based on the actual data volume, 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 if the cluster configuration is not being changed.
  • You can add more than one node to only a PolarDB for MySQL cluster at a time. You can add a maximum of 15 read-only nodes to a PolarDB for MySQL cluster at a time.
  • You can remove more than one node to only a PolarDB for MySQL cluster at a time. You must retain at least one read-only node in the cluster to ensure high availability.
  • It takes about 5 minutes to add or remove a node.

Add read-only nodes

Note If a session that supports read/write splitting is created after you add a read-only node, the read requests are forwarded to the read-only node. If a session that supports read/write splitting is created before you add a read-only node, the read requests are not forwarded to the read-only node. To enable the read requests to be forwarded to the added read-only node, you must close the connection and establish the connection again. For example, you can restart your 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 the service agreement, select the check box, and then click Buy Now.
    Note If you need to add multiple nodes to your PolarDB for MySQL cluster at a time, click + Add a read-only node for each of the nodes to be added.
  6. On the Purchase page, confirm the unpaid order and click Purchase.

Remove read-only nodes

  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 can remove more than one node to only a PolarDB for MySQL cluster at a time. 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.