If you fail to connect to an ApsaraDB RDS for PostgreSQL instance, you can use the self-service diagnostics feature to troubleshoot connection issues. This topic describes how to use the self-service diagnostics feature to diagnose the connections that are established to an RDS instance over the Internet and internal networks.
Background information
After you create an RDS instance, you may fail to connect to the RDS instance. In most cases, connection failures may occur due to network connection issues. To quickly troubleshoot connection issues, ApsaraDB RDS for MySQL provides the self-service diagnostics feature.
Implementation
The self-service diagnostics feature can test the connectivity between the connection initiator and your RDS instance. For example, if the IP address of the connection initiator is not added to the IP address whitelist of your RDS instance, the connectivity test fails.
The self-service diagnostics feature can test whether the IP address of the connection initiator is within a CIDR block that is added to the IP address of your RDS instance. If the IP address of the connection initiator is within the CIDR block, the connectivity test succeeds.
Usage notes
If your RDS instance is deployed in a virtual private cloud (VPC), the Elastic Compute Service (ECS) instance that resides in the same VPC can connect to your RDS instance over an internal network. If the ECS instance and the RDS instance reside in different VPCs, the ECS instance cannot connect to the RDS instance even if the IP address of the ECS instance is added to the IP address whitelist of the RDS instance.
Procedure
Log on to the ApsaraDB RDS console and go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
In the left-side navigation pane, click Database Connection.
In the Connection Troubleshooting section, add the private IP address of an Elastic Compute Service (ECS) instance or public IP address of an on-premises device that can be used to connect to your RDS instance.
To add an internal endpoint, click the Intranet Troubleshooting tab and click Add intranet ECS IP. In the dialog box that appears, select the ECS instance that you want to add, add it to the Selected ECS instances section, and then click OK.
To add a public endpoint, click the Extranet Troubleshooting tab, click Add Extranet IP. In the dialog box that appears, enter the IP address or click Load Local Public IP Address (If there is a network proxy on your PC, please turn it off first). Then, click OK.
NoteYou can obtain the public IP address of your local computer in one-click mode only when the network proxy is disabled.
Click Start Check.
Perform subsequent operations based on different test statuses.
Status
Operation
Normal
In this case, no action is required.
IP Address Not in the Whitelist
Click Configure Whitelist in the Actions column to add the IP address to the whitelist. For more information, see Configure an IP address whitelist for an ApsaraDB RDS for PostgreSQL instance.
Abnormal
Click Submit Ticket in the Actions column to submit a ticket.
References
You can add the private IP address of your ECS instance or the public IP address of your on-premises device to an IP address whitelist of the RDS instance. For more information, see Configure an IP address whitelist.
If you want to connect to the RDS instance over the Internet, you can apply for a public endpoint. For more information, see Apply for or release a public endpoint.
After the self-service diagnostics feature is enabled, you can connect to the RDS instance by using the PostgreSQL CLI, the pgAdmin client, or an application. For more information, see Connect to an ApsaraDB RDS for PostgreSQL instance.