This topic describes how to configure PolarProxy for a PolarDB cluster by modifying the configuration of the cluster endpoint.

Prerequisites

The PolarDB for MySQL cluster is of the Cluster Edition Edition or X-Engine Edition. You cannot configure PolarProxy for a cluster of Single Node Edition. For more information about cluster editions, see Editions.

Precautions

  • You can enable hybrid transaction/analytical processing (HTAP) and configure the degree of parallelism only when you configure PolarProxy for a PolarDB for MySQL 8.0 cluster.

Procedure

  1. Log on to the PolarDB console.
  2. In the upper-left corner of the console, select the region in which the cluster that you want to manage is deployed.
  3. Find the cluster and click the cluster ID.
  4. In the Dedicated Enterprise Edition or Standard Enterprise Edition section on the Overview page, find the cluster endpoint and click Modify next to the cluster endpoint.
  5. In the dialog box that appears, modify the configuration of the cluster endpoint based on your business requirements. The following table describes the parameters.
    Table 1. Parameters
    ParameterDescription
    Network InformationPolarDB provides a virtual private cloud (VPC) endpoint for each cluster by default. You can modify the VPC endpoint or apply for a public endpoint Apply for a cluster endpoint or a primary endpoint.
    Cluster SettingsRead/write ModeThe read/write mode of the cluster endpoint. You can select Read Only or Read and Write (Automatic Read-write Splitting).
    Note You can change the read/write mode of a custom cluster endpoint after the custom cluster endpoint is added. After you change the read/write mode, the new mode takes effect only on newly created connections. The existing connections still work in the original mode.
    Endpoint NameThe name of the cluster endpoint.
    Node SettingsUnselected Nodes and Selected NodesSelect the nodes that you want to associate with the cluster endpoint to process read requests from the Unselected Nodes list on the left. The Unselected Nodes list contains the primary node and all read-only nodes. Then click 1 to add the nodes to the Selected Nodes list on the right.
    Note The type of nodes that you select does not affect the read/write mode.
    • If you set the read/write mode to Read and Write (Automatic Read-write Splitting), write requests are sent only to the primary node regardless of whether the primary node is selected.
    • If the read/write mode is Read Only, all read requests are forwarded to read-only nodes instead of the primary node in load balancing mode. Even if the primary node is added to the Selected Nodes list, read requests are not forwarded to it.
    Automatically Associate New NodesSpecifies whether to automatically associate a newly added node with the cluster endpoint.
    SLB SettingsLoad Balancing PolicyThe policy for scheduling read requests among read-only nodes when read/write splitting is enabled. Valid values: Load Balance Based on Connections and Active Request-based Load Balancing. For more information about load balancing policies, see Load balancing policies.
    Primary Node Accepts Read Requests
    • If you set this parameter to No, read requests are sent only to read-only nodes to reduce the loads of the primary node.
    • If you set this parameter to Yes, read requests are sent to the primary node and read-only nodes.
    For more information, see Primary node accepts read requests.
    Note This parameter is available only if the read/write mode is set to Read and Write (Automatic Read-write Splitting).
    Transaction SplittingSpecifies whether to enable the transaction splitting feature. For more information, see Transaction splitting.
    Note This parameter is available only if the read/write mode is set to Read and Write (Automatic Read-write Splitting).
    Consistency SettingsConsistency Level
    • If you set the read/write mode to Read and Write (Automatic Read-write Splitting), the following consistency levels are available: Eventual Consistency (Weak), Session Consistency (Medium), and Global Consistency (Strong). For more information, see Consistency levels.
    • If you set the read/write mode to Read Only, the default consistency level is Eventual Consistency (Weak) and cannot be changed.
    Note Changes to the consistency level immediately take effect on all connections.
    Global Consistency TimeoutThe timeout period of achieving global consistency among read-only nodes. Unit: milliseconds. Valid values: 0 to 6000. Default value: 20.
    Note This parameter is available only if you set Consistency Level to Global Consistency (Strong).
    Global Consistency Timeout PolicyThe default policy to be applied if PolarDB fails to achieve global consistency among read-only nodes within the specified timeout period. Valid values:
    • Send Requests to Primary Node (Default)
    • SQL Exception: Wait replication complete timeout, please retry.
    Note This parameter is available only if you set Consistency Level to Global Consistency (Strong).
    Connection Pool SettingsConnection PoolYou can set the parameter to Off, Session-level, or Transaction-level. Default value: Off. For more information about connection pools, see Connection pools.
    Note This parameter is available only if you set the read/write mode to Read and Write (Automatic Read-write Splitting).
    HTAP OptimizationParallel QuerySpecifies whether to enable the parallel query feature, sets a parallelism value, and selects the parallel query engine. By default, the parallel query feature is disabled. For more information, see Overview. Parallel query engines include Single-node Parallel Query and Cross-node Parallel Query.
    • Single-node Parallel Query: uses the multi-core CPU in a single node to accelerate parallel queries. For more information, see Overview.
    • Cross-node Parallel Query: uses computing resources of all nodes in a cluster to accelerate parallel queries. For more information, see Multi-Node Elastic Parallel Query.
    Transactional/Analytical Processing SplittingSpecifies whether to enable the automatic request distribution between row store and column store nodes feature. For more information, see Automatic request distribution among row store and column store nodes.
    Note This parameter is available only when the following requirements are met: The cluster runs on PolarDB for MySQL 8.0.1 and the revision version is 8.0.1.1.22 or later. The cluster endpoint is in Read and Write mode. Selected Nodes in Node Settings contain at least one read-only column store node.
    Security ProtectionEnable Overload ProtectionSpecifies whether to enable the overload protection feature. For more information, see Overload protection.
  6. Click OK.

Related API operations

OperationDescription
DescribeDBClusterEndpointsQueries the cluster endpoints of a PolarDB cluster.
ModifyDBClusterEndpointModifies the configurations of a PolarDB cluster endpoint.
DeleteDBClusterEndpointDeletes a custom cluster endpoint of a PolarDB cluster.