You can manually add or remove nodes after you create a PolarDB cluster.
Background information
A PolarDB for PostgreSQL centralized cluster supports different numbers of read-only nodes depending on its database engine type. A centralized cluster whose database engine is Enterprise Edition has one primary node and supports up to 15 read-only nodes. A centralized cluster whose database engine is Standard Edition has one primary node and supports up to 7 read-only nodes. The cluster uses an active-active failover mechanism to enable smooth and automatic role transitions between nodes and ensure high database availability.
A PolarDB for PostgreSQL distributed cluster has at least one compute node and one data node and supports the addition or removal of nodes.
Add read-only nodes that have different specifications from the primary node
For PolarDB for PostgreSQL centralized clusters whose database engine is Enterprise Edition or Standard Edition, you can add read-only nodes that have different specifications from the primary node.
For PolarDB for PostgreSQL distributed clusters, you cannot add nodes that have different specifications from existing compute or data nodes.
Limits
At least one read-only node in the cluster must have the same specifications as the primary node.
Make sure that the specifications of new read-only nodes do not differ greatly 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
When a primary/read-only node failover occurs, the system does not allow a read-only node that has different specifications from the primary node to become the new primary node.
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 the subscription billing method.
If you add a read-only node to a pay-as-you-go cluster, the new node is also billed on the pay-as-you-go billing method.
You can release subscription or pay-as-you-go read-only nodes based on your business requirements. After you release a node, the system issues refunds for the remaining subscription period or stops billing. For more information, see Configuration change fees.
When you add a node, you are charged based on the specifications of the node. For more information, see Billable items. The storage fees vary based on the actual storage usage and are not influenced by the number of nodes.
Prerequisites
No specifications change tasks are ongoing on the PolarDB cluster.
Precautions
You can add or remove nodes from a cluster only if the cluster does not have ongoing specifications change tasks.
To minimize the risk of errors, we recommend that you add or remove only one node at a time. To add or remove multiple nodes, repeat the actions in separate operations.
For a PolarDB for PostgreSQL centralized cluster whose database engine is Enterprise Edition or Standard Edition, node addition requires approximately 5 minutes. The process has no impact on the database operations.
When you remove a node from a PolarDB for PostgreSQL centralized cluster whose database engine is Enterprise Edition or Standard Edition, connections to the removed node are briefly disconnected. Other nodes of the cluster are unaffected. We recommend that you remove nodes during off-peak hours and make sure that your applications can automatically reconnect to the cluster.
When you add a compute node or data node to a PolarDB for PostgreSQL distributed cluster, your services are blocked for 1 minute due to the lock mechanism. To minimize the impact on business continuity, we recommend that you add nodes during off-peak hours or maintenance windows.
When you remove a node from a PolarDB for PostgreSQL distributed cluster, the impact varies based on the type of the removed node.
When you remove a compute node, connections to the node are briefly interrupted. Other nodes of the cluster are not affected. We recommend that you remove compute nodes during off-peak hours and make sure that your applications can automatically reconnect to the cluster.
When you delete a data node, data is automatically migrated in the background. The required time for the migration is proportional to the amount of data stored on the node. The migration consumes system resources and has an estimated CPU and I/O resource utilization of up to 20%. To minimize impact on business performance, we recommend that you remove data nodes during off-peak hours or maintenance windows.
Add nodes
Select a method to add nodes based on the cluster type.
PolarDB for PostgreSQL centralized cluster
PolarDB for PostgreSQL centralized clusters refer to clusters whose database engine is Enterprise Edition or Standard Edition.
Log on to the PolarDB console. In the left-side navigation pane, click Clusters. In the upper-left corner of the page, select the region in which the cluster resides and find the cluster in the list.
Go to the Add/Remove Node page by using one of the following methods:
Click More > Add/Remove Node in the Actions column of the cluster.

Click the cluster ID. On the Basic Information page of the cluster, click Add/Remove Node in the Database Nodes section.

Select Add Node and click OK.

Click + Add a Read-only Node and configure the switching time.
NoteBefore you add nodes that have different specifications from the primary node, make sure that at least one node in the cluster has the same specifications as the primary node.
To add multiple nodes to your cluster at the same time, repeatedly click the + Add a read-only node option.
You can set the Switching Time parameter to Switch Now or Switch At. If you select Switch At, you can specify a point in time within the next 24 hours. Your cluster is upgraded or downgraded 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.
Complete the payment based on the billing method that you select.
Pay-as-you-go
Read the terms of service. If you agree to them, click Buy Now.
Subscription
Read the terms of service. If you agree to them, click Buy Now.
On the Purchase page, confirm the order and payment method and click Subscribe.
PolarDB for PostgreSQL distributed cluster
Log on to the PolarDB console. In the left-side navigation pane, click Clusters. In the upper-left corner of the page, select the region in which the cluster resides and click the ID of the cluster to go to the Basic Information page.
In the Configurations section, click Add Node.

Click + Add a Node and configure the switching time.
NoteYou can set the Switching Time parameter to Switch Now or Switch At. If you select Switch At, you can specify a point in time within the next 24 hours. Your cluster is upgraded or downgraded 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.
Complete the payment based on the billing method that you select.
Pay-as-you-go
Read the terms of service. If you agree to them, click Buy Now.
Subscription
Read the terms of service. If you agree to them, click Buy Now.
On the Purchase page, confirm the order and payment method and click Subscribe.
Remove nodes
Select a method to remove a node based on the cluster type.
PolarDB for PostgreSQL centralized cluster
PolarDB for PostgreSQL centralized clusters refer to clusters whose database engine is Enterprise Edition or Standard Edition.
Log on to the PolarDB console. In the left-side navigation pane, click Clusters in the left-side navigation pane. In the upper-left corner of the page, select the region in which the cluster resides and find the cluster in the list.
Go to the Add/Remove Node page by using one of the following methods:
Click More > Add/Remove Node in the Actions column of the cluster.

Click the cluster ID. On the Basic Information page of the cluster, click Add/Remove Node in the Database Nodes section.

Select Delete Node and click OK.

Click the-symbol to the left of the node that you want to delete and configure the switching time parameter.
NoteA cluster can contain only one primary node. To ensure high availability of the cluster, we recommend that you retain at least one read-only node in the cluster.
You can set the Switching Time parameter to Switch Now or Switch At. If you select Switch At, you can specify a point in time within the next 24 hours. Your cluster is upgraded or downgraded 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.
Complete the payment based on the billing method that you select.
Pay-as-you-go
Read the terms of service. If you agree to them, click Buy Now.
Subscription
Read the terms of service. If you agree to them, click Buy Now.
On the Purchase page, confirm the order and payment method and click Subscribe.
PolarDB for PostgreSQL distributed cluster
Log on to the PolarDB console. In the left-side navigation pane, click Clusters. In the upper-left corner of the page, select the region in which the cluster resides and click the ID of the cluster to go to the Basic Information page.
In the Configurations section, click Delete Node.

Click the-symbol to the left of the node that you want to delete and configure the switching time.
NoteA cluster must contain at least one compute node and one data node.
You can set the Switching Time parameter to Switch Now or Switch At. If you select Switch At, you can specify a point in time within the next 24 hours. Your cluster is upgraded or downgraded 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.
Complete the payment based on the billing method that you select.
Pay-as-you-go
Read the terms of service. If you agree to them, click Buy Now.
Subscription
Read the terms of service. If you agree to them, click Buy Now.
On the Purchase page, confirm the order and payment method and click Subscribe.
Related API operations
Operation | Description |
Adds read-only nodes to a PolarDB cluster. | |
Removes read-only nodes from a PolarDB cluster. | |
Changes the specifications of nodes in a PolarDB cluster. | |
Changes the specifications of a node in a PolarDB cluster. | |
Restarts a node in a PolarDB cluster. |