All Products
Search
Document Center

PolarDB:Add or remove read-only nodes

Last Updated:Mar 14, 2024

After you create a PolarDB cluster, you can manually add read-only nodes with the required specifications or remove read-only nodes that you no longer need.

Prerequisites

No cluster specification change tasks are being performed for the PolarDB cluster.

Separately change the specifications of the primary node and read-only nodes

You can add read-only nodes based on your business requirements. This means that the specifications of read-only nodes do not have to be consistent with those of the primary node.

Limits

  • An Enterprise Edition cluster contains at least one primary node and up to 15 read-only nodes. A Standard Edition cluster contains at least one primary node and up to 8 read-only nodes.

  • Limits for the specifications of new read-only nodes:

    • The memory size of a new read-only node must be at least half of the memory size of the primary node.

    • The minimum number of CPU cores allowed for a new read-only node varies based on the number of CPU cores of the primary node, as listed in the following table.

      CPU cores for the primary node

      Minimum CPU cores for a read-only node

      2

      2

      4

      4

      8

      4

      16

      8

      32

      16

      64

      32

      88

      32

    • Each cluster must contain at least one read-only node that has the same specifications as those of the primary node.

    • The specifications of the read-only nodes that serve as hot standby nodes must be the same as those of the primary node. For more information about hot standby nodes, see Configure hot standby nodes.

    • We recommend that you specify higher specifications for read-only column store nodes than the primary node. For more information, see Add a read-only column store node.

Note

PolarDB Multi-master Cluster (Database/Table) Edition is not subject to the preceding limits.

Billing rules

You are charged for new nodes based on the following billing rules:

  • If you add a read-only node to a subscription cluster, the new node is also billed on a subscription basis.

  • If you add a read-only node to a pay-as-you-go cluster, the new node is also billed on a pay-as-you-go basis.

Note
  • You can release read-only nodes that use the subscription and pay-as-you-go methods as needed. After you release a node, the system refunds fees for the remaining subscription period or stops billing. For more information, see Configuration change fees.

  • You are charged only for the specifications of new nodes. For more information, see Billable items. Storage fees are still billed based on the actual storage usage and do not depend on the number of nodes.

Impacts of node quantity on cluster performance

For more information, see OLTP performance test.

Usage notes

  • PolarDB for MySQL Cluster Edition and X-Engine Edition allow you to add up to 15 read-only nodes at a time.

  • Only PolarDB for MySQL clusters support the concurrent removal of multiple read-only nodes. However, you must keep at least one read-only node in the cluster to ensure high availability.

  • It takes about 5 minutes to add a read-only node. The time consumption varies based on multiple factors, such as the number of nodes that are added, the numbers of tables and databases, and the database loads. When PolarDB adds a read-only node to a cluster, the databases in the cluster are not affected.

  • When PolarDB removes a read-only node from a cluster, transient connections occur to the removed node. The connections to the other nodes in the cluster are not affected. We recommend that you remove nodes during off-peak hours and make sure that your applications are configured with the automatic reconnection mechanism. 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. However, existing read sessions are not redirected to the read-only node. To resolve this issue, you can close and re-create these sessions by restarting your applications. Then, sessions are established to the newly added node.

  1. Log on to the PolarDB console.

  2. In the top navigation bar, select the region in which the cluster that you want to manage 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 and click the cluster ID to go to the Basic Information page.

      2. In the Database Nodes section, click the 1 icon to change the display mode.

      3. Click Add/Remove Node.

      基本信息

  4. Select Add Node and click OK.

    增删节点向导

  5. Click + Add a read-only node, specify Switching Time, read and accept the terms of service, and then click Buy Now.

    Note
    • If you want to add multiple nodes to your PolarDB for MySQL cluster at a time, click + Add a read-only node again to add more nodes.

    • You can set Switching Time to Switch Now or Switch At. If you select Switch At, you can specify a point in time within the next 24 hours. The nodes will be added within 30 minutes after the specified point in time. On the Scheduled Tasks page, you can view the details of the task or cancel the task. For more information, see View or cancel a scheduled task.

  6. On the Purchase page, confirm the order information and click Subscribe.

Delete Read-Only Node

  1. Log on to the PolarDB console.

  2. In the top navigation bar, select the region in which the cluster that you want to manage 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 and click the cluster ID to go to the Basic Information page.

      2. In the Database Nodes section, click the 1 icon to change the display mode.

      3. Click Add/Remove Node.

      基本信息

  4. Select Delete Node and click OK.

    1

  5. Click the 减号图标icon to the left of a node name to remove the node.

    Note

    Only PolarDB for MySQL clusters support the concurrent removal of multiple read-only nodes. However, you must keep at least one read-only node in the cluster to ensure high availability.

  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 period or stops billing. For more information, see Configuration change fees.

Related API operations

Operation

Description

CreateDBNodes

Adds a read-only node to a PolarDB cluster.

ModifyDBNodesClass

Changes the specifications of a single node in a PolarDB cluster.

ModifyDBNodeClass

Changes the node specifications of a PolarDB cluster.

RestartDBNode

Restarts a node in a PolarDB cluster.

DeleteDBNodes

Removes a read-only node from a PolarDB cluster.