You can modify the default cluster endpoint or custom cluster endpoints for ApsaraDB PolarDB PostgreSQL-compatible edition clusters. You can specify cluster endpoint settings, such as the read/write mode, the consistency level, and the associated read-only nodes, to meet your business requirements and improve service flexibility.
- Log on to the PolarDB console.
- In the upper-left corner of the console, select the region where the cluster is deployed.
- Find the cluster and click the cluster ID.
- In the Endpoints section, find the cluster endpoint that you want to modify, and choose on the right side of the cluster endpoint.
- In the Configure Nodes dialog box, set the following parameters.
Parameter Description Read/write Mode The read/write mode of the custom cluster endpoint. Available modes are Read Only and Read and Write (Automatic Read-write Splitting).Note After you change the read/write mode, existing connections are closed. Make sure that your application can automatically reconnect to the cluster. Reader Nodes The nodes that you want to associate with the cluster endpoint to process read requests. You can select the nodes on the left side. Available nodes are the primary node and all the read-only nodes.Note
- If you set Read/write Mode to Read and Write (Automatic Read-write Splitting), you must select at least two nodes, including the primary node.
- If you set Read/write Mode to Read Only, you can create single-node endpoints. If you create a single-node endpoint for a read-only node and the read-only node becomes faulty, the single-node endpoint may be unavailable for up to 1 hour. We recommend that you do not create single-node endpoints in the production environment. We recommend that you select at least two nodes to improve cluster availability.
Automatically Associate New Nodes Specifies whether a new node is automatically associated with the cluster endpoint. Load Balancing Policy The policy for scheduling read requests among multiple read-only nodes if read/write splitting is enabled. The default value is Load-based Automatic Scheduling and cannot be changed. Consistency Level
- If you set Read/write Mode to Read and Write (Automatic Read-write Splitting), available consistency levels are Eventual Consistency (Weak) and Session Consistency (Medium). For more information, see Consistency levels.
- If you set Read/write Mode to Read Only, the default consistency level is Eventual Consistency (Weak) and cannot be changed.
Primary Node Accepts Read Requests After this feature is enabled, SQL statements are sent to only read-only nodes. This reduces the load on the primary node and ensures the stability of the primary node.Note You can configure this feature only after you set Read/write Mode to Read and Write (Automatic Read-write Splitting). Transaction Splitting Specifies whether to enable the transaction splitting feature. For more information, see Configure transaction splitting.Note You can configure this feature only after you set Read/write Mode to Read and Write (Automatic Read-write Splitting).
- Click OK.
Related API operations
|DescribeDBClusterEndpoints||Queries cluster endpoints.|
|ModifyDBClusterEndpoint||Modifies a cluster endpoint.|