This topic provides answers to frequently asked questions about how to connect to PolarDB clusters.
Am I charged for data traffic if my application uses a public endpoint to connect to a PolarDB cluster?
No, you are not charged for data traffic that is incurred by using public endpoints of PolarDB clusters.
What is the maximum number of single-node cluster endpoints that I can create in a cluster?
You can create up to six custom cluster endpoints for a cluster. The custom cluster endpoints can be single-node cluster endpoints. For more information about how to create a single-node cluster endpoint, see Create a custom cluster endpoint.
WarningIf you create a single-node cluster endpoint for a read-only node and the read-only node fails to run as expected, the single-node cluster endpoint may be unavailable for up to 1 hour. We recommend that you do not create single-node cluster endpoints in your production environment.
If a single-node cluster endpoint is created for a read-only node, can the read-only node be used as the new primary node after a failover?
The read-only node for which a single-node cluster endpoint is created cannot be automatically used as the new primary node after a failover. However, you can manually promote the read-only node as the new primary node. For more information, see Automatic failover and manual failover.
What is the maximum number of cluster endpoints that can be created for a cluster?
A cluster can contain a maximum of seven cluster endpoints. One cluster endpoint is the default cluster endpoint and the other endpoints are custom cluster endpoints.
Can I modify a cluster endpoint?
Yes, you can modify the default cluster endpoint and custom cluster endpoints. For more information, see Change the endpoint of a cluster.
Can I delete a cluster endpoint?
Yes, you can delete only custom cluster endpoints. You cannot delete the default cluster endpoint. For more information, see Delete an endpoint.
Why am I unable to connect an ECS instance to the internal endpoint of a PolarDB cluster?
To connect an ECS instance to the internal endpoint of a PolarDB cluster, the following requirements must be met:
The ECS instance and PolarDB cluster are deployed in the same region.
The ECS instance and PolarDB cluster use the same network type. If they use the VPC network type, they must be on the same VPC. If the ECS instance and PolarDB cluster are not on the same VPC, you can Use CEN and Basic Edition transit routers to connect VPCs in the same region.
The private IP address of the ECS instance is added to the whitelist of the PolarDB cluster.
If the PolarDB cluster is on a VPC while the ECS instance is on the classic network, you can use one of the following solutions to connect the ECS instance to the internal endpoint of the PolarDB cluster:
Solution 1: Migrate the ECS instance from the classic network to the VPC where the PolarDB cluster is deployed. For more information, see Migrate ECS instances from a classic network to a VPC.
NoteIf the ECS instance also needs to access other resources on the classic network, do not migrate the ECS instance. Otherwise, the ECS instance cannot access the classic network.
Solution 2: use the ClassicLink feature to connect the classic network to the VPC network.
Why am I unable to connect an ECS instance to the public endpoint of a PolarDB cluster?
You can perform the following steps:
Check whether the endpoint, port, account, and password for the connection are correct. If yes, check whether the IP whitelist of the PolarDB cluster is correct.
Add
0.0.0.0/0to the IP whitelist of the PolarDB cluster. After the cluster is connected, execute theSHOW processliststatement to obtain the egress public IP address of the cluster. Add it to the whitelist of the cluster and delete0.0.0.0/0from the whitelist.Note0.0.0.0/0in the IP whitelist indicates that all sources are allowed to access the cluster. Do not add 0.0.0.0/0 to the IP whitelist of the cluster unless it is necessary.
The primary node and read-only nodes of the PolarDB cluster use the same parameter configurations. Why is the error message regarding max_join_size reported?
When the read-only nodes of a PolarDB cluster are handling a large number of queries, the size of data returned by join operations exceeds the value of the
max_join_sizeparameter. As a result, the error is reported. SetSET SQL_BIG_SELECTS=1before executing queries to optimize query performance.Why am I unable to connect an ECS instance to a PolarDB cluster?
An ECS instance can be connected to a PolarDB cluster over the internal network when the following requirements are met: using the same account, in the same region, and on the same VPC. VPC isolation exists for different accounts or across different regions. PolarDB Common reasons why an ECS instance cannot connect to a PolarDB cluster:
A whitelist that is not configured or is incorrectly configured for a cluster. If an Internet connection is used, check whether the egress IP address changes.
Network issues. You can run the
ping Cluster endpointortelnet Cluster endpoint:Portcommand on the server to test network connectivity.Virtual hosts and lightweight servers cannot be used to connect to a PolarDB cluster over the internal network.
Check whether the PolarDB cluster is overloaded and whether the PolarDB cluster is running.
The internal IP subnet assigned to the PolarDB cluster overlaps with the subnet used by another service. You can use one of the following solutions if this issue occurs:
Solution 1: Change the vSwitch of the PolarDB cluster to ensure that the subnet of the cluster does not conflict with the subnet of other services.
ImportantBy default, resources in one VPC cannot directly access resources in another VPC by using internal IP addresses. To resolve the subnet conflict, we recommend that you change the vSwitch of the PolarDB cluster without changing the VPC. This ensures that other Alibaba Cloud services can still connect to the PolarDB cluster over the VPC.
Solution 2: Change the default subnet of the conflicting service.
In the following procedure, Docker containers in a Linux system are used as an example.
Stop the Docker service.
sudo systemctl stop dockerEdit the Docker configuration file. In most cases, the Docker configuration file is located at
/etc/docker/daemon.jsonor/etc/docker/daemon.conf.sudo vim /etc/docker/daemon.jsonConfigure the new subnet.
{"bip": "New subnet"}For example, you can change the subnet to 192.168.0.0/16.
Save and close the configuration file.
Restart the Docker service to allow the modification to take effect.
sudo systemctl start docker