All Products
Search
Document Center

PolarDB:View or apply for an endpoint

Last Updated:Mar 13, 2025

PolarDB clusters support the following types of endpoints: primary endpoint, cluster endpoint (also known as the default cluster endpoint), and custom endpoint. You can use one of the preceding endpoint types to connect to a PolarDB cluster. We recommend that you use the default cluster endpoint.

Endpoints

  • PolarDB for PostgreSQL centralized cluster whose Database Edition is Enterprise Edition or Standard Edition

    image
  • PolarDB for PostgreSQL distributed cluster

    image

Endpoint

Description

Network type

Cluster endpoint (recommended)

Each PolarDB for PostgreSQL centralized cluster whose Database Edition is Enterprise Edition or Standard Edition has a default cluster endpoint. PolarProxy provides services to support the default cluster endpoint.

The default cluster endpoint supports automatic read/write splitting. Write requests are routed to the primary node and read requests are routed to read-only nodes. For more information about PolarProxy, see PolarProxy.

Note

A PolarDB for PostgreSQL distributed cluster does not have a default cluster endpoint.

  • Private network

  • Public network

Primary endpoint

Each PolarDB cluster supports only a single primary endpoint. The primary endpoint has the following features:

  • Always connects to the primary node or primary compute node (CN) and supports read and write operations.

  • When the primary node or primary CN fails, the primary endpoint automatically connects to the new primary node.

Custom endpoint

  • PolarDB for PostgreSQL centralized cluster

    PolarDB for PostgreSQL centralized clusters refer to clusters whose Database Edition is Enterprise Edition or Standard Edition.

    • You can create up to five custom endpoints. PolarProxy provides services to support custom endpoints.

    • You can configure the read/write mode of a custom endpoint to read/write splitting or read-only. You can also configure the load balancing policy for a custom endpoint. For more information, see Configure PolarProxy.

    • You can associate one or more read-only nodes with a custom endpoint. Requests that use the custom endpoint are routed only to the associated read-only nodes.

    Note

    You can associate only one node with a PolarDB custom endpoint. If the only node becomes faulty, the endpoint may be unavailable for up to 1 hour. We recommend that you associate more than one node with an endpoint in production environments.

  • PolarDB for PostgreSQL distributed cluster

    • You can create up to six custom endpoints.

    • The unified endpoint for multiple CNs cannot be used to execute DDL statements, such as DDL statements for creating or deleting tables or accounts. It can be used to execute DML and DQL statements. To execute DDL statements, use the primary endpoint.

Private endpoints and public endpoints

Network type

Description

Scenario

Private network

  • A PolarDB cluster can achieve optimal performance when the cluster is connected by using a private endpoint.

  • By default, a cluster has a private endpoint. You can modify but cannot release the private endpoint. For information about how to modify a private endpoint, see Modify an endpoint.

Examples:

  • If your Elastic Cloud Service (ECS) instance is deployed in the same virtual private cloud (VPC) as the cluster, your ECS instance can access the cluster by using the private endpoint.

  • You can use Data Management (DMS) to access clusters over VPCs.

Public network

  • You can apply for or delete a public endpoint. For more information, see Apply for a public network endpoint.

  • The public network is the Internet. A PolarDB cluster cannot achieve optimal performance when it is connected over the public network.

Example: You can connect to a cluster over the public network to perform maintenance operations.

View endpoints and ports

  1. Log on to the PolarDB console. Click Clusters in the left-side navigation pane. In the upper-left corner of the page, select the region in which the cluster resides, and then click the ID of the cluster to go to the Basic Information page.

  2. Select a method to view the endpoint and port based on the cluster type.

    PolarDB for PostgreSQL centralized cluster

    PolarDB for PostgreSQL centralized clusters refer to clusters whose Database Edition is Enterprise Edition or Standard Edition.

    In the Database Connections section of the Basic Information page, move the pointer over an endpoint. Then, you can view the endpoints and port numbers in the Network Information section in the dialog box that appears.

    image

    Note

    If you use a domain name to connect to a database, you can click Bind Private Domain Name to bind the domain name to a private endpoint. This way, you can retain the original database domain name after the database is migrated to the cloud. You can bind private domain names only to Private endpoints. For more information, see Private domain names.

    PolarDB for PostgreSQL distributed cluster

    In the Database Connection section, move the pointer over the private network or public endpoint. Then, you can view the endpoint and port number in the dialog box that appears.

    image

Apply for a public endpoint

  1. Log on to the PolarDB console. Click Clusters in the left-side navigation pane. In the upper-left corner of the page, select the region in which the cluster resides and click the ID of the cluster to go to the Basic Information page.

  2. Apply for an endpoint based on the cluster type.

    PolarDB for PostgreSQL centralized cluster

    PolarDB for PostgreSQL centralized clusters refer to clusters whose Database Edition is Enterprise Edition or Standard Edition.

    1. In the Database Connections section of the Basic Information page, find the endpoint and click Apply to the right of the Public parameter.

      image

      Note

      You can apply only for Public endpoints. When you create a cluster or a custom endpoint, a private endpoint is automatically created. You do not need to apply for this endpoint.

    2. In the dialog box that appears, specify a prefix for the endpoint and click OK.

      Note

      The prefix of the endpoint must meet the following requirements:

      • The prefix must be 6 to 40 characters in length and can contain lowercase letters, digits, and hyphens (-).

      • The prefix must start with a letter and end with a digit or a letter.

    PolarDB for PostgreSQL distributed cluster

    1. In the Database Connections section of the Basic Information page, find the endpoint and click Apply to the right of Public Endpoint parameter.

      image

    2. In the dialog box that appears, specify a prefix for the endpoint and click OK.

      Note

      The prefix of the endpoint must meet the following requirements:

      • The prefix must be 6 to 40 characters in length and can contain lowercase letters, digits, and hyphens (-).

      • The prefix must start with a letter and end with a digit or a letter.

What to do next

Connect to the cluster. For more information, see Connect to a cluster

Related API operations

Operation

Description

DescribeDBClusterEndpoints

Queries the endpoints of a specified PolarDB cluster.

CreateDBEndpointAddress

Creates a public endpoint for a PolarDB cluster.

ModifyDBEndpointAddress

Modifies the endpoints of a PolarDB cluster.

DeleteDBEndpointAddress

Deletes the public endpoints of a PolarDB cluster.