All Products
Search
Document Center

PolarDB:Add or remove read-only nodes

更新時間:Jul 18, 2024

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

Prerequisites

No configuration changes are in progress on the PolarDB cluster.

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

You can add read-only nodes that have specifications different from the primary node based on your business requirements.

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 eight read-only nodes.

  • Make sure that the specifications of new read-only nodes do not significantly differ from the specifications of the primary node.

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

    • The number of CPU cores of a new read-only node must have the following mapping relationships with the number of CPU cores of the primary node.

      CPU cores of the primary node

      Minimum CPU cores of 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 the primary node.

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

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

Note

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

Billing rules

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

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

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

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

  • The fees for the nodes that you add vary based on the node specifications. For more information, see Billable items. The storage fees are based on the actual storage usage and are not affected by 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 the same time.

  • Only PolarDB for MySQL clusters support removal of multiple read-only nodes at the same time. To ensure high availability, you must retain at least one read-only node in the cluster.

  • The time required to add a read-only node is approximately 5 minutes. The actual time varies based on multiple factors, such as the number of nodes that are added, the numbers of tables and databases, and the database load. Adding a read-only node does not affect the databases in the cluster.

  • After you remove a read-only node from a PolarDB for MySQL cluster, connections to the read-only node are closed. Connections to other nodes in the cluster are not affected. We recommend that you remove read-only nodes during off-peak hours and make sure that your applications can automatically reconnect to the cluster. If your application is connected to the cluster endpoint, the node removal process is transparent to the application. You do not need to modify the configurations of the application for node removal.

Add a read-only node

Note

Read-write sessions established after you add a read-only node forward requests to the read-only node. However, read-write sessions established before you add a read-only node do not forward requests to the read-only node. To resolve this issue, you can close and re-create the sessions by restarting your applications. Then, the sessions forward requests to the read-only node.

  1. Log on to the PolarDB console.

  2. In the left-side navigation pane, click Clusters.

  3. In the upper-left corner, select the region where the cluster to which you want to connect is deployed.

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

  5. Select Add Node and then click OK.

    Mysql节点增加

  6. Click + Add Read-only Node, configure the Switching Time parameter, read and select the terms of services, 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 to add more nodes.

    • You can set the Switching Time parameter to Switch Now or Switch At. If you set the parameter to Switch At, you can specify a point in time within the next 24 hours. The node is added within 30 minutes after the specified point in time. On the Scheduled Tasks, you can view the details of the task or cancel the task. For more information, see Scheduled tasks.

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

Remove a read-only node

  1. Log on to the PolarDB console.

  2. In the left-side navigation pane, click Clusters.

  3. In the upper-left corner, select the region where the cluster to which you want to connect is deployed.

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

  5. Select Delete Node and then click OK.

    1

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

  7. Note

    Only PolarDB for MySQL clusters support concurrent removal of multiple read-only nodes. To ensure high availability, you must retain at least one read-only node in a cluster.

  8. Read and select the terms of service and then click Buy Now.

    Note

    After a node is removed, the system refunds you 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.

ModifyDBNodesClass

Changes the specifications of nodes in a PolarDB cluster.

ModifyDBNodeClass

Changes the specifications of a node in a PolarDB cluster.

RestartDBNode

Restarts a node in a PolarDB cluster.

DeleteDBNodes

Removes read-only nodes from a PolarDB cluster.