All Products
Search
Document Center

PolarDB:Configure PolarProxy

Last Updated:Feb 28, 2024

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

Prerequisites

This feature is available for clusters of PolarDB for MySQL Cluster Edition and X-Engine Edition. You cannot configure PolarProxy for a cluster of Single Node Edition. For more information about cluster editions, see Editions.

Usage notes

You can enable the parallel query feature 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 of the Basic Information page, find the cluster endpoint and click Modify next to the cluster endpoint.

    7.png

  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 that you can configure.

    Table 1. Parameters

    Parameter

    Description

    Network Information

    By default, PolarDB provides a virtual private cloud (VPC) endpoint for each cluster. You can modify the VPC endpoint or apply for a public endpoint. For more information, see Manage the endpoints of a cluster.

    Cluster Settings

    Read/Write

    The read/write mode of the cluster endpoint. You can select Read-only or Read/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 new connections. Existing connections still work in the original mode.

    Endpoint Name

    The name of the cluster endpoint.

    Node Settings

    Available Nodes and Selected Nodes

    Select the nodes that you want to associate with the cluster endpoint to process read requests from the Available Nodes list on the left. The Available Nodes list contains the primary node and all read-only nodes. Then, click the 1 icon 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/Write (Automatic Read/Write Splitting), write requests are sent only to the primary node regardless of whether the primary node is added to the Selected Nodes list.

    • If you set the read/write mode to Read-only, all read requests are forwarded to read-only nodes instead of the primary node in load balancing mode. Read requests are not forwarded to the primary node even if the primary node is added to the Selected Nodes list.

    Automatically Associate New Nodes

    Specifies whether to automatically associate a new node with the cluster endpoint.

    SLB Settings

    Load Balancing Policy

    The policy for scheduling read requests among read-only nodes when read/write splitting is enabled. Valid values: Connections-based Load Balancing and Active Request-based Load Balancing. For more information about load balancing policies, see the "Load balancing policies" section of the Load balancing topic.

    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 the "Primary Node Accepts Read Requests" section of the Load balancing topic.

    Note

    This parameter is available only if you set the read/write mode to Read/Write (Automatic Read/Write Splitting).

    Transaction Splitting

    Specifies whether to enable the transaction splitting feature. For more information, see the "Transaction splitting" section of the Load balancing topic.

    Note

    This parameter is available only if you set the read/write mode to Read/Write (Automatic Read/Write Splitting).

    Consistency Settings

    Consistency Level

    • If you set the read/write mode to Read/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 Timeout

    The timeout period of achieving global consistency among read-only nodes. Valid values: 0 to 60000. Default value: 20. Unit: milliseconds.

    Note

    This parameter is available only if you set Consistency Level to Global Consistency (Strong).

    Global Consistency Timeout Policy

    The default policy to be applied if global consistency fails to be achieved among the PolarDB read-only nodes within the specified 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 Settings

    Connection Pool

    Valid values: Off, Session-level, and 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/Write (Automatic Read/Write Splitting).

    HTAP Optimization

    Parallel Query

    Specifies whether to enable the parallel query feature and specifies the degree of parallelism.

    The elastic parallel query (ePQ) feature can effectively use multi-core CPUs and idle computing resources in a cluster to accelerate complex queries. For more information, see Overview.

    Note

    Starting from April 1, 2023, the ePQ feature can be enabled for a cluster if the cluster meets the following conditions. The default degree of parallelism is 2.

    • For a new cluster, the number of CPU cores is greater than or equal to 8.

    • For an existing cluster, a custom cluster endpoint is created, and the number of CPU cores is greater than or equal to 8.

    Transactional/Analytical Processing Splitting

    Specifies whether to enable the automatic request distribution among 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 if the following requirements are met: The cluster runs PolarDB for MySQL 8.0.1 and the revision version of the cluster is 8.0.1.1.22 or later. The cluster endpoint is in Read/Write (Automatic Read/Write Splitting) mode. The Selected Nodes list in Node Settings contain at least one read-only column store node.

    Column store nodes handle OLTP requests

    Specifies whether to allow column store nodes to handle Online transaction processing (OLTP) requests.

    If column store nodes are allowed to handle OLTP requests, the nodes receive Online Analytical Processing (OLAP) and OLTP requests. PolarProxy routes OLTP read requests to column store nodes based on the number of active requests. This may increase the loads on the nodes.

    Note

    This parameter is required only when Transactional/Analytical Processing Splitting is enabled.

    Security Protection

    Enable Overload Protection

    Specifies whether to enable the overload protection feature. For more information, see Overload protection.

  6. Click OK.

Related API operations

Operation

Description

DescribeDBClusterEndpoints

Queries the cluster endpoints of a PolarDB cluster.

ModifyDBClusterEndpoint

Modifies the configurations of a PolarDB cluster endpoint.

DeleteDBClusterEndpoint

Deletes a custom cluster endpoint of a PolarDB cluster.