Add or remove nodes

更新时间:
复制 MD 格式

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

Background

A PolarDB cluster can have up to 15 read-only nodes. To ensure high availability, we recommend that you keep at least one read-only node. In a cluster, at least one read-only node must have the same specifications as the primary node. You can configure the specifications for other read-only nodes as needed.

Billing

New nodes use the same billing method as the cluster:

  • If your cluster uses the Subscription billing method (prepaid), added nodes are also billed on a Subscription basis.

  • If your cluster uses the Pay-As-You-Go billing method (postpaid or hourly), added nodes are also billed on a Pay-As-You-Go basis.

Note

Precautions

  • You can add or remove read-only nodes only when no configuration changes are in progress for the cluster.

  • You can remove multiple read-only nodes at the same time. However, to prevent operational errors, we recommend that you add or remove only one node at a time.

  • Adding a read-only node takes about 5 minutes. This operation does not affect your database.

  • Removing a read-only node briefly interrupts its connections. Other nodes are not affected. We recommend that you perform this operation during off-peak hours and ensure your application has an automatic reconnection mechanism. If your application connects to the cluster endpoint, PolarDB automatically removes the deleted node from the endpoint, so you do not need to change your application configuration.

Add a read-only node

Note

After you add a read-only node, new read/write splitting connections forward requests to it. Existing connections will not automatically use the new node. To route requests from existing connections to the new node, you must reconnect them. For example, you can restart your application.

  1. Log on to the PolarDB console. In the navigation pane on the left, click Clusters. Select the cluster's region and then find the cluster.

  2. Navigate to the Add/Remove Node wizard using either of the following methods:

    • In the Operation column, click Add/Remove Node.

    • Click the cluster ID. On the Basic Information page, in the database nodes section, click Add/Remove Node.

  3. Select Add Node and click OK.

    Adding a node takes about 5 minutes. The default cluster endpoint automatically recognizes the new node for load balancing.

  4. Click + Add Read-only Node, select a Switching Time, accept the terms of service, and then click Buy Now.

    Note
    • To add multiple nodes to your cluster at the same time, click + Add Read-only Node repeatedly.

    • For Switching Time, you can select Switch Now or Switch At. If you select Switch At, you can specify any time within the next 24 hours. The node-adding task completes within 30 minutes of the scheduled time. You can also view task details or cancel the task on the Scheduled Tasks page. For more information, see Scheduled Tasks.

Remove a read-only node

  1. Log on to the PolarDB console. In the navigation pane on the left, click Clusters. Select the cluster's region and then find the cluster.

  2. Navigate to the Add/Remove Node wizard using either of the following methods:

    • In the Operation column, click Add/Remove Node.

    • Click the cluster ID. On the Basic Information page, in the database nodes section, click Add/Remove Node.

  3. Select Delete Node and click OK.

  4. Click the 减号图标 icon next to the node you want to delete.

  5. Accept the terms of service, and then click Buy Now.

    Note

    You can release subscription and pay-as-you-go read-only nodes at any time. After a node is released, billing for the node stops, and you may receive a refund.

API reference

API

Description

CreateDBNodes

Adds nodes to a PolarDB cluster.

ModifyDBNodeClass

Modifies the specifications of a node in a PolarDB cluster.

RestartDBNode

Restarts a node in a PolarDB cluster.

DeleteDBNodes

Deletes nodes from a PolarDB cluster.