You can use a cluster endpoint or a primary endpoint of a PolarDB cluster to connect to the cluster. This topic describes how to apply for and manage a cluster endpoint or a primary endpoint.

Apply for a cluster endpoint or a primary 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, you can apply for an endpoint by using one of the following methods:
    • Method 1:
      1. In the upper-right corner of the Endpoints section, click the Switch views icon to switch the view.
      2. Click Apply. 1
    • Method 2:
      1. On the right side of the cluster endpoint, click Modify.
      2. In the Network Information section of the dialog box that appears, click Apply. 4
    Note You can apply only for Public-facing Endpoint endpoints. After you create a cluster, a default VPC-facing Endpoint endpoint is provided. You do not need to apply for this endpoint.
  5. 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 30 characters in length, and can contain lowercase letters, digits, and hyphens (-).
    • The prefix must start with a lowercase letter and end with a digit or a lowercase letter.
    After an application for the cluster endpoint is approved, all features that can be provided by the PolarDB proxy are supported. You can modify the parameters of the features provided by the PolarDB proxy based on your business requirements. For more information, see Configure the PolarDB proxy.

Create a custom cluster endpoint

In the Endpoints section of the Overview page, click Create Custom Cluster Endpoint. In the dialog box that appears, create a custom cluster endpoint and configure the features provided by the PolarDB proxy for the custom cluster endpoint. For more information, see Configure the PolarDB proxy.

View an endpoint

You can view the domain name and port number of an endpoint by using one of the following methods:
  • In the upper-right corner of the Endpoints section, click the Switch views icon to switch the view. Then, you can view the domain name and port number of the endpoint. E
  • On the right side of the cluster endpoint, click Modify. In the Network Information section of the dialog box that appears, you can view the domain name and port number of the endpoint. 2
Note
  • If you use a domain name to connect to a database, you can click Bind Private Domain to bind the domain name to a private endpoint. This allows you to retain the original database domain name after the database is migrated to the cloud. Only VPC-facing Endpoint endpoints can be bound to private domain names. For more information, see Private domain names.
  • The default port number of an endpoint that is used by an ApsaraDB PolarDB MySQL-compatible edition cluster is 3306. You can change the port number. For more information, see Modify an endpoint.

Modify an endpoint

You can change the domain name and port number for an endpoint by using one of the following methods:
  • In the upper-right corner of the Endpoints section, click the Switch views icon to switch the view. Then, find the endpoint that you want to manage and click Modify. 1
  • On the right side of the cluster endpoint, click Modify. In the Network Information section of the dialog box that appears, choose More > Modify. 2
Notice
  • The prefix of the endpoint must meet the following requirements:
    • The prefix must be 6 to 30 characters in length, and can contain lowercase letters, digits, and hyphens (-).
    • The prefix must start with a lowercase letter and end with a digit or a lowercase letter.
  • The port number ranges from 3000 to 3500.
  • If SSL is enabled for the endpoint, the cluster restarts after you modify the endpoint.
  • If SSL is enabled for the endpoint, the total length of the new endpoint cannot exceed 64 characters.

Delete an endpoint

Warning
  • Before you delete an endpoint, make sure that your application is connected to the cluster by using another endpoint.
  • A deleted endpoint cannot be recovered. If you need an endpoint, click Apply to apply for a new endpoint. For more information, see Apply for a cluster endpoint or a primary endpoint.
  • The default cluster endpoint can be modified but cannot be deleted. Custom cluster endpoints can be deleted.
You can delete an endpoint by using one of the following methods:
  • In the upper-right corner of the Endpoints section, click the Switch views icon to switch the view. Then, find the endpoint that you want to manage and click Delete. 1
  • On the right side of the cluster endpoint, click Modify. In the Network Information section of the dialog box that appears, choose More > Delete. 1
Note You can delete only Public-facing Endpoint endpoints.

What to do next

Connect to a cluster

Related API operations

API Description
DescribeDBClusterEndpoints Queries the endpoints of a specified PolarDB cluster.
CreateDBEndpointAddress Creates a public endpoint for a specified PolarDB cluster.
ModifyDBEndpointAddress Modifies the default endpoint of a specified PolarDB cluster.
DeleteDBEndpointAddress Deletes a cluster endpoint of a specified PolarDB cluster.