You can manage cluster endpoints in the PolarDB console. For example, you can create and delete a custom cluster endpoint, or modify the configurations of a cluster endpoint. This topic describes how to manage a PolarDB cluster endpoint.

Prerequisites

The edition of the PolarDB for MySQL cluster is Cluster Edition. This feature is unavailable for Single Node and Archive Database. For more information about the editions, see Product editions.

Considerations

  • A PolarDB cluster uses a maximum of four cluster endpoints, including one default cluster endpoint and three custom cluster endpoints.
  • You can modify the configurations of the default cluster endpoint but you cannot delete the default cluster endpoint. Only custom cluster endpoints can be deleted.
  • Parallel queries and parallelism are supported only when you configure a custom cluster endpoint for a PolarDB 8.0 cluster.

Create a custom cluster endpoint

  1. Log on to the PolarDB console.
  2. In the upper-left corner of the console, select the region where the cluster is deployed.
  3. Find the cluster and click the cluster ID.
  4. In the Endpoints section of the Overview page, click Create Custom Cluster Endpoint.
  5. In the Create Custom Cluster Endpoint dialog box, set the following parameters.
    Table 1. Parameters
    Parameter Description
    Network Information By default, PolarDB provides a public-facing endpoint for each cluster endpoint. For more information about how to modify the public-facing endpoint or apply for a VPC-facing endpoint,see Modify an endpoint and port number and Apply for an endpoint.
    Cluster Settings Read/write Mode Specifies the read/write mode for the custom cluster endpoint. You can select Read Only or Read and Write (Automatic Read-write Splitting).
    Note You can modify the read/write mode after you create a custom cluster endpoint. Changes to the read/write mode take effect on only new connections. The existing connections use the original read/write mode.
    Endpoint Name Specifies the name of the custom cluster endpoint.
    Node Settings Unselected Nodes and Selected Nodes Select the nodes that you want to add to process read requests from the Unselected Nodes section on the left and click the 1 icon. Then, move the nodes to the Selected Nodes section on the right.
    Note
    • In the Unselected Nodes section, you can select the primary node and all read-only nodes.
    • The setting of the nodes 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 to only the primary node regardless of whether the primary node is selected or not.
    • PolarDB allows you to create a cluster endpoint that contains only one node. However, when the read/write mode is set to Read Only, you cannot create a single-node cluster endpoint that contains only one primary node. For more information, see Create a custom cluster endpoint.
    Automatically Associate New Nodes Specifies whether a new node is automatically associated with the cluster endpoint.
    SLB Settings Load Balancing Policy Specifies the policy for distributing 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.
    Offload Reads from Primary Node After this feature is enabled, SQL statements are sent to only read-only nodes. This reduces the loads on the primary node and ensures the stability of the primary node. For more information, see Read/write splitting.
    Note This parameter is available only if you use the Read and Write (Automatic Read-write Splitting) mode.
    Transaction Splitting Specifies whether to enable the transaction splitting feature. For more information, see Transaction splitting.
    Note You can configure this feature only after you set Read/write Mode to Read and Write (Automatic Read-write Splitting) and set Consistency Level to Session Consistency (Medium) or Global Consistency (Strong).
    Consistency Settings Consistency 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 the connections.
    Global Consistency Timeout Specifies the timeout period of synchronizing the latest data to read-only nodes. Unit: milliseconds. Valid values: 0 to 6000. Default value: 20.
    Note This parameter is supported only if you set Consistency Level to Global Consistency (Strong).
    Global Consistency Timeout Policy Specifies the default policy to be applied if global consistency is not achieved among the PolarDB read-only nodes within the specified time period. Valid values:
    • Send Requests to Primary Node (Default)
    • SQL Exception: Wait replication complete timeout, please retry.
    Note This parameter is supported only if you set Consistency Level to Global Consistency (Strong).
    Connection Pool Settings Connection Pool You can select Off (default value), Session-level, or Transaction-level. For more information, see Connection pool.
    Note You can configure this feature only after you set the read/write mode to Read and Write (Automatic Read-write Splitting).
    HTAP Optimization Parallel Query Specifies whether to enable the parallel query feature. For more information, see Parallel query.
    Note This parameter is supported by only custom cluster endpoints in Read Only mode of PolarDB for MySQL 8.0.
  6. Click OK.

Modify a cluster endpoint

  1. Log on to the PolarDB console.
  2. In the upper-left corner of the console, select the region where the cluster is deployed.
  3. Find the cluster and click the cluster ID.
  4. In the Endpoints section on the Overview page, find the cluster endpoint and click Modify on the right side of the cluster endpoint.
  5. In the dialog box that appears, specify the parameters. For more information, see Parameters.
  6. Click OK.

Delete a custom cluster endpoint

  1. Log on to the PolarDB console.
  2. In the upper-left corner of the console, select the region where the cluster is deployed.
  3. Find the cluster and click the cluster ID.
  4. In the Endpoints section on the Overview page, find the cluster endpoint and click Delete on the right side of the cluster endpoint.
    Note You can delete only custom cluster endpoints. You cannot delete the default cluster endpoint.
  5. In the message that appears, click OK.

Related API operations

API Description
DescribeDBClusterEndpoints Queries cluster endpoints of a specified PolarDB cluster.
ModifyDBClusterEndpoint Modifies the attributes of a specified PolarDB cluster endpoint.
DeleteDBClusterEndpoint Deletes a custom endpoint of a specified PolarDB cluster.