You can manually add or remove read-only nodes after you create a PolarDB cluster.
Background
A PolarDB cluster of Cluster Edition can contain up to 15 read-only nodes. Each cluster must have at least one read-only node to ensure high availability. All nodes in a cluster use the same specifications.
Billing methods of nodes
You are charged for newly added nodes based on the following billing methods:
- If a node is added to a subscription cluster, you are charged based on the subscription billing method.
- If a node is added to a pay-as-you-go cluster, you are charged based on the pay-as-you-go billing method.
Note
- You can release subscription or pay-as-you-go read-only nodes based on your business requirements. After you release a node, the system refunds fees for the remaining subscription period or stops billing. For more information, see Configuration change fees.
- Only the specifications of the added nodes are charged. For more information, see Billable items. The storage fee is charged based on the used storage, regardless of the number of nodes.
Impact of the node quantity on performance
For more information, see OLTP performance tests.
Considerations
- You can add or remove read-only nodes only when the cluster does not have pending specification changes.
- Only PolarDB for MySQL clusters allow you to add multiple read-only nodes at a time. You can add up to 15 read-only nodes to a cluster.
- Only PolarDB for MySQL clusters allow you to remove multiple read-only nodes at a time. However, you must keep at least one read-only node in the cluster to ensure high availability.
- It requires about 5 to 10 minutes to add a node. The consumed time depends on the factors such as the number of new nodes, the number of tables, and the loads of the database.
- You may experience PolarDB service interruptions for a few seconds during specification changes. During this time, you cannot perform some operations. We recommend that you change specifications during off-peak hours and make sure that your applications can automatically reconnect to the cluster.
Add a read-only node
Note After you add a read-only node, the read requests of new read/write splitting sessions
are forwarded to the read-only node. The read requests of read/write splitting sessions
that are created before you add a read-only node are not forwarded to the newly added
read-only node. To forward these read requests to the added read-only node, you must
close the connection and reconnect to the cluster. For example, you can restart your
application to establish the connection.
Remove read-only nodes
Related API operations
API | Description |
---|---|
CreateDBNodes | Adds a read-only node to a PolarDB cluster. |
ModifyDBNodeClass | Changes the node specifications of a PolarDB cluster. |
RestartDBNode | Restarts a specified node in a PolarDB cluster. |
DeleteDBNodes | Deletes read-only nodes from a PolarDB cluster. |