Manage endpoints
You can connect to a database cluster by using thePolarDBcluster endpoint and the primary endpoint of the cluster. This topic describes how to apply for a cluster endpoint and a primary endpoint.
View endpoints and ports
-
Log in to the PolarDB console,In the navigation pane on the left, click Clusters. Select the Region where the cluster is deployed, and then click the cluster ID to go to the cluster details page。
-
On theBasic Informationpage, in theDatabase Connectionssection, hover over the target endpoint. In the dialog box that appears, you can view the network informationNetwork Information, including thePrivate/Publicendpoint, port number, and related links.
-
If you previously connected to the database by using a domain name and want to keep the domain name after the database is migrated to the cloud, you can clickBind Private Domain Nameto bind it. OnlyPrivateendpoints support private domain name binding. For more information, see Private domain names.
-
PolarDBendpoints have a default port number of 3306. You can also customize the port number.
-
PolarDBAll nodes in a PolarDB cluster, including the primary node and read-only nodes, share the same database account and password. To view the database account name, view the created database accounts inon the cluster details page.
Apply for a public endpoint
-
Log in to the PolarDB console,In the navigation pane on the left, click Clusters. Select the Region where the cluster is deployed, and then click the cluster ID to go to the cluster details page。
-
On the clusterBasic Informationpage, in theDatabase Connectionssection, find the target endpoint. To the right ofPublic, clickApply.
NoteYou can apply only for aPublicendpoint. APrivateendpoint is generated by default when the cluster is created, so you do not need to apply for it.
-
In the dialog box that appears, set the endpoint prefix and clickOK.
Note-
The endpoint prefix must meet the following requirements:
-
It must be 6 to 40 characters in length and can contain only lowercase letters, digits, and hyphens (-).
-
It must start with a lowercase letter and end with a digit or a letter.
-
-
If the error message "The node specification has insufficient resources in this zone. Please try another zone" appears, the public domain name that you specified may have already been used. You can try another domain name.
-
-
After the cluster endpoint is created, the database proxy feature is automatically enabled. You can modify the database proxy settings as needed. For more information, see Configure the database proxy.
NoteAfter the application succeeds, the public endpoint takes effect immediately. You can view it in theDatabase Connectionssection. If it does not appear immediately, refresh the page.
Create a custom cluster endpoint
You can also go to the clusterBasic Informationpage, in theDatabase Connectionssection and clickCreate Custom Cluster Endpointto create a custom endpoint and configure the database proxy features. For more information, see Configure the database proxy.
Currently,PolarDB for MySQLCluster Edition allows you to specify a VPC and a vSwitch when you create a new endpoint. For more information, see Change the VPC and vSwitch.
Modify an endpoint
You can go to the clusterBasic Informationpage, in theDatabase Connectionssection, find the target endpoint. To the right ofPrivateorPublic, click
> Edit to modify the endpoint.
-
The endpoint prefix must meet the following requirements:
-
It must be 6 to 40 characters in length and can contain only lowercase letters, digits, and hyphens (-).
-
It must start with a lowercase letter and end with a digit or a letter.
-
-
The port number must be in the range of 3000 to 5999.
-
If SSL is enabled for the endpoint, modifying it causes the cluster to restart.
-
If SSL is enabled for the endpoint, the total length of the modified endpoint cannot exceed 64 characters.
Currently,PolarDBCluster Edition allows you to change the VPC and vSwitch of a single endpoint. For more information, see Change the VPC and vSwitch.
Release an endpoint
-
Before you release an endpoint, make sure that your applications already use the new endpoint.
-
A released endpoint cannot be recovered. You can onlyApply.
-
The default cluster endpoint only supports modifying its configuration and cannot be released. Custom cluster endpoints can be released.
You can go to the clusterBasic Informationpage, in theDatabase Connectionssection, find the target endpoint. To the right ofPublic, click
>Releaseto release the endpoint.
Only Public endpoints can be released.
What's next
API reference
API | Description |
Queries the endpoints of a cluster. | |
Creates a public endpoint for a cluster. | |
Modifies the default endpoint of a cluster. | |
Releases an endpoint of a cluster. |