After you create a PolarDB cluster, you can manually add or remove nodes.
Background
For centralized PolarDB for PostgreSQL clusters, different Editions support different numbers of read-only nodes (a cluster can also contain only a primary node). When the Edition is Enterprise Edition, a single cluster contains one primary node and up to fifteen read-only nodes, and when the Edition is Standard Edition, a single cluster contains one primary node and up to seven read-only nodes. The primary and read-only nodes use an Active-Active failover mechanism to provide high availability for the database.
A PolarDB for PostgreSQL (Distributed Edition) cluster must contain at least one compute node and one data node, and supports elastic scale-out.
Add nodes with different specifications
For a PolarDB for PostgreSQL (Centralized Edition) cluster (Edition: Enterprise Edition or Standard Edition), you can add read-only nodes with different specifications. The specifications of the read-only nodes do not need to match those of the primary node.
PolarDB for PostgreSQL (Distributed Edition) does not support adding nodes with specifications different from those of the existing compute or data nodes.
Limitations
In the same cluster, ensure that at least one read-only node has the same specifications as the primary node.
We recommend avoiding significant specification differences between new read-only nodes and the primary node:
The memory of the new read-only node cannot be less than half the memory of the primary node.
The following table describes the CPU specification requirements for new read-only nodes relative to the primary node.
Primary node CPU (cores)
Minimum read-only node CPU (cores)
2
2
4
4
8
4
16
8
32
16
64
32
88
32
Failover to a read-only node with specifications different from the primary node is not supported.
Billing
The billing method for new nodes matches the cluster's billing method:
If the cluster is Subscription-based, new nodes are also subscription-based.
If the cluster is pay-as-you-go, new nodes are also pay-as-you-go.
You can release Subscription and pay-as-you-go read-only nodes at any time. After a node is released, a refund is issued or billing stops.
When you add a node, you are charged only for the node's specifications. For more information, see Billable items. Storage fees are based on actual usage and are independent of the number of nodes.
Prerequisites
Ensure that no configuration changes are in progress on the PolarDB cluster.
Usage notes
You can add or remove a node only when no other configuration changes are in progress on the cluster.
To prevent operational errors, we recommend that you add or remove only one node at a time. To add or remove multiple nodes, perform the operation multiple times.
For a PolarDB for PostgreSQL (Centralized Edition) cluster (Edition: Enterprise Edition or Standard Edition), adding a node takes about 5 minutes. This operation does not affect your database.
For a PolarDB for PostgreSQL (Centralized Edition) cluster (Edition: Enterprise Edition or Standard Edition), when you remove a read-only node, connections to that node experience a brief interruption. Other nodes are not affected. We recommend that you perform this operation during off-peak hours and ensure your application has an automatic reconnection feature.
For a PolarDB for PostgreSQL (Distributed Edition) cluster, when you add a compute node or data node, a lock mechanism may block your services for up to 1 minute. To minimize business impact, we recommend that you perform this operation during off-peak hours or within a scheduled maintenance window.
For a PolarDB for PostgreSQL (Distributed Edition) cluster, removing different types of nodes has different impacts:
When you remove a compute node, connections to that node experience a brief interruption. Other nodes are not affected. We recommend that you remove compute nodes during off-peak hours and ensure your application has an automatic reconnection feature.
When you remove a data node, the system automatically performs data migration in the background. The migration time is proportional to the amount of data on the node. This process consumes system resources, with an estimated CPU and I/O utilization of no more than 20%. To minimize performance impact, we recommend that you perform this operation during off-peak hours or within a scheduled maintenance window.
Add a node
To add a node, follow the procedure for your cluster type.
PolarDB for PostgreSQL (Centralized Edition)
A centralized PolarDB for PostgreSQL cluster is a cluster whose Edition is Enterprise Edition or Standard Edition.
Log on to the PolarDB console. In the left-side navigation pane, click Clusters. Select the region where your cluster is located and then find the cluster.
Open the Node Addition and Deletion Wizard wizard in one of the following ways:
In the Operation column, click Add/Remove Node.
Click the cluster ID to open the Overview page. In the Database Nodes section, click Add/Remove Node.
Select Add Node and click OK.
In the Add/Remove Node wizard, note that adding a node takes approximately 5 minutes. If you use the default cluster endpoint, it automatically includes the new node for load balancing. Read-only nodes can be removed later.
Click + Add a Read-only Node and select a Switching Time.
NoteBefore you add a node with different specifications, make sure that at least one read-only node in the cluster has the same specifications as the primary node.
To add multiple nodes to the cluster, click + Add a Read-only Node repeatedly.
You can set the 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 configuration upgrade is completed within 30 minutes after the specified time. You can view the task details or cancel the task on the Scheduled Tasks page. For more information, see Scheduled Tasks.
Complete the payment based on the billing method of your cluster.
Pay-As-You-Go
Click Buy Now. By doing so, you acknowledge and agree to the service agreement and any product-specific terms you have selected on this page (if any).
Subscription
Click Buy Now. By doing so, you acknowledge and agree to the service agreement and any product-specific terms you have selected on this page (if any).
On the Payment page, confirm the unpaid order information and payment method, and then click Pay.
PolarDB for PostgreSQL (Distributed Edition)
Log on to the PolarDB console. In the left-side navigation pane, click Clusters. Select the region where your cluster is located, and click the cluster ID to open the cluster details page.
In the Configuration Information section, click Add Node.
Click + Add a Node and select a Switching Time.
NoteYou can set the 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 configuration upgrade is completed within 30 minutes after the specified time. You can view the task details or cancel the task on the Scheduled Tasks page. For more information, see Scheduled Tasks.
Complete the payment based on the billing method of your cluster.
Pay-As-You-Go
Click Buy Now. By doing so, you acknowledge and agree to the service agreement and any product-specific terms you have selected on this page (if any).
Subscription
Click Buy Now. By doing so, you acknowledge and agree to the service agreement and any product-specific terms you have selected on this page (if any).
On the Payment page, confirm the unpaid order information and payment method, and then click Pay.
Remove a node
To remove a node, follow the procedure for your cluster type.
PolarDB for PostgreSQL (Centralized Edition)
A centralized PolarDB for PostgreSQL cluster refers to a cluster whose Edition is Enterprise Edition or Standard Edition.
Log on to the PolarDB console. In the left-side navigation pane, click Clusters. Select the region where your cluster is located and then find the cluster.
Open the Node Addition and Deletion Wizard wizard in one of the following ways:
In the Operation column, click Add/Remove Node.
Click the cluster ID to open the Overview page. In the Database Nodes section, click Add/Remove Node.
Select Remove Node and click OK.
Click the - icon next to the node that you want to remove, and then select a Switching Time.
NoteA cluster can contain only a primary node. However, to ensure high availability, we recommend retaining at least one read-only node in the cluster.
You can set the 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 configuration upgrade is completed within 30 minutes after the specified time. You can view the task details or cancel the task on the Scheduled Tasks page. For more information, see Scheduled Tasks.
Complete the payment based on the billing method of your cluster.
Pay-As-You-Go
Click Buy Now. By doing so, you acknowledge and agree to the service agreement and any product-specific terms you have selected on this page (if any).
Subscription
Click Buy Now. By doing so, you acknowledge and agree to the service agreement and any product-specific terms you have selected on this page (if any).
On the Payment page, confirm the unpaid order information and payment method, and then click Pay.
PolarDB for PostgreSQL (Distributed Edition)
Log on to the PolarDB console. In the left-side navigation pane, click Clusters. Select the region where your cluster is located, and click the cluster ID to open the cluster details page.
In the Configuration Information section, click Remove Node.
Click the - icon next to the node that you want to remove, and then select a Switching Time.
NoteA cluster must contain at least one compute node and one data node.
You can set the 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 configuration upgrade is completed within 30 minutes after the specified time. You can view the task details or cancel the task on the Scheduled Tasks page. For more information, see Scheduled Tasks.
Complete the payment based on the billing method of your cluster.
Pay-As-You-Go
Click Buy Now. By doing so, you acknowledge and agree to the service agreement and any product-specific terms you have selected on this page (if any).
Subscription
Click Buy Now. By doing so, you acknowledge and agree to the service agreement and any product-specific terms you have selected on this page (if any).
On the Payment page, confirm the unpaid order information and payment method, and then click Pay.
API reference
API | Description |
Adds nodes to a PolarDB cluster. | |
Removes nodes from a PolarDB cluster. | |
Modifies the specifications of a single node in a PolarDB cluster. | |
Modifies the specifications of nodes in a PolarDB cluster. | |
Restarts a node in a PolarDB cluster. |