All Products
Search
Document Center

PolarDB:View or apply for an endpoint

Last Updated:Nov 21, 2024

When you connect to a PolarDB cluster, you must provide an endpoint of the PolarDB cluster. A PolarDB cluster provides a public endpoint and a private endpoint for each endpoint. This topic describes how to view and apply for an endpoint in the PolarDB console.

Primary endpoint and cluster endpoints

连接地址示意图

Endpoint

Description

Network type

Cluster endpoint (recommended)

  • An application can connect to multiple nodes by connecting to a cluster endpoint.

  • Cluster endpoints support read/write splitting. They automatically forward write requests to the primary node and forward read requests to the primary node or read-only nodes based on the load on each node.

Note

A PolarDB cluster provides a default cluster endpoint. You can create one or more custom cluster endpoints based on your business requirements. When you create a custom cluster endpoint, you can specify the nodes that can be connected by using the endpoint and specify the read/write mode. For more information, see Configure PolarProxy.

  • Internal network

  • Internet

Primary endpoint

  • The primary endpoint allows you to connect to the primary node of the cluster. The primary endpoint can be used for read and write operations.

  • When the primary node is faulty, the primary endpoint is switched to a new primary node.

Internal endpoints and public endpoints

Network type

Description

Scenario

Internal network

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

  • When you create a cluster, a default internal endpoint is generated. You can modify the endpoint but cannot delete it. For information about how to modify an internal endpoint, see Modify an endpoint.

Example:

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

  • You can connect to your cluster by using Data Management (DMS).

Internet

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

  • A PolarDB cluster cannot achieve optimal performance when it is connected by using a public endpoint.

Example: You can connect to a cluster by using a public endpoint to perform maintenance operations.

View endpoints and ports

  1. Log on to the PolarDB console.

  2. In the left-side navigation pane, click Clusters.

  3. In the upper-left corner, select the region in which the cluster is deployed.

  4. Find the cluster and click its ID.

  5. In the Database Connections section of the Basic Information page, you can use one of the following methods to view the endpoint and port information of the cluster:

    • Method 1

      Click the 切换 icon in the upper-right corner of the Database Connections section to view the endpoint and port information.

      E

    • Method 2

      Click Configure to the right of the cluster endpoint. In the dialog box that appears, view the endpoint and port information in the Network Information section.

      2

    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.

Apply for an endpoint

  1. Log on to the PolarDB console.

  2. In the left-side navigation pane, click Clusters.

  3. In the upper-left corner, select the region in which the cluster is deployed.

  4. Find the cluster and click its ID.

  5. In the Database Connections section of the Basic Information page, you can use one of the following methods to apply for an endpoint.

    • Method 1

      1. Click the 切换 icon in the upper-right corner of the Database Connections section to switch views.

      2. Click Apply.2

    • Method 2:

      1. Click Modify to the right of the cluster endpoint.

      2. In the Network Information section of the dialog box that appears, click Apply.2

    Note
    • You can apply only for Public endpoints.

    • When you create a cluster, a default Private endpoint is generated. You do not need to apply for this endpoint.

  6. 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 a cluster

Related API operations

Operation

Description

DescribeDBClusterEndpoints

Queries the endpoints of a PolarDB cluster.

CreateDBEndpointAddress

Creates a public endpoint for a PolarDB cluster.

ModifyDBEndpointAddress

Modifies the default endpoint of a PolarDB cluster.

DeleteDBEndpointAddress

Deletes a cluster endpoint of a PolarDB cluster.