All Products
Search
Document Center

PolarDB:Add or remove a read-only node

更新時間:Aug 26, 2024

You can manually add or remove read-only nodes after you create a PolarDB 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 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 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.

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

Precautions

  • You can add or remove read-only nodes only when the cluster does not have pending specification changes.

  • To avoid accidental operations, only one read-only node can be added or removed at a time. To add or remove multiple read-only nodes, repeat the operation for multiple times.

  • It takes about five minutes to add or remove a read-only node. 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 can automatically reconnect to the cluster. 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. 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 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, select the region in which the cluster is deployed.

  3. Access the Add/Remove Node wizard by using one of the following methods:

    • Access the Add/Remove Node wizard from the Clusters page.

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

      集群列表

    • Access the Add/Remove Node wizard from the Basic Information page of the cluster.

      1. Find the cluster that you want to manage and click the cluster ID to go to the Basic Information page.

      2. In the Database Nodes section, click Add/Remove Node.

        image

  4. Select Add Node and then click OK.

    Mysql节点增加

  5. Click + Add a read-only node. Read the service agreement, select the check box, and then click Buy Now.

Remove a read-only node

  1. Log on to the PolarDB console.

  2. In the upper-left corner, select the region in which the cluster is deployed.

  3. Access the Add/Remove Node wizard by using one of the following methods:

    • Access the Add/Remove Node wizard from the Clusters page.

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

      集群列表

    • Access the Add/Remove Node wizard from the Basic Information page of the cluster.

      1. Find the cluster that you want to manage and click the cluster ID to go to the Basic Information page.

      2. In the Database Nodes section, click Add/Remove Node.

        image

  4. Select Delete Node and then click OK.

    1

  5. Click the Minus sign (-) icon icon to the left of a node name to remove the node.

  6. Read the service agreement, select the check box, and then 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

Operation

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 a read-only node from a PolarDB cluster.