After you complete the initial configurations, you can use an Elastic Compute Service (ECS) instance or a database client to connect to an ApsaraDB RDS for PPAS instance.

You can use a database client or Alibaba Cloud Data Management (DMS) to connect to an RDS instance. This topic describes how to connect to an ApsaraDB RDS for PPAS instance by using DMS and the pgAdmin 4 client.

Background information

You can log on to DMS from the ApsaraDB for RDS console and then connect to an RDS instance. DMS provides an integrated solution for data management. DMS supports data management, schema management, access control, BI charts, trend analysis, data tracking, performance optimization, and server management. DMS can be used to manage NoSQL databases and relational databases, such as MySQL, SQL Server, PostgreSQL, MongoDB, and Redis. It can also be used to manage Linux servers.

You can also use a database client to connect to an RDS instance. ApsaraDB RDS for PPAS is fully compatible with PPAS. You can connect to RDS in the similar way you connect to an on-premises PPAS server. This topic describes how to use the pgAdmin 4 client to connect to an RDS instance. This topic also serves as a reference if you choose to use other database clients. When you use a client to connect to an RDS instance, you must select the internal and public endpoints based on your network environment:

  • If the client is deployed on an ECS instance that resides in the same region and has the same network type as the RDS instance, you can use the internal endpoint. For example, if the ECS and RDS instances both reside in VPCs in the China (Hangzhou) region, use the internal endpoint to establish a secure connection.
  • In other situations, use the public endpoint.

Use DMS to connect to an RDS instance

For more information, see Use DMS to log on to an ApsaraDB for RDS instance.

Use a client to connect to an RDS instance

  1. Add the IP address that is used to access your RDS instance to an IP address whitelist. For more information about how to configure an IP address whitelist, see Configure an IP address whitelist for an ApsaraDB RDS for PPAS instance.
  2. Start the pgAdmin 4 client.
  3. Right-click Servers and choose Create > Server.
  4. On the General tab of the Create - Server dialog box, enter the name of the server.
  5. Click the Connection tab and enter the information of the target RDS instance.

    Parameter description:

    • Host name/address: Enter the endpoint of the RDS instance. If you connect to the RDS instance over the internal network, enter the internal endpoint of the RDS instance. If you connect to the RDS instance over the Internet, enter the public endpoint of the RDS instance. To view the internal and public endpoints and port numbers of the RDS instance, follow these steps:

      1. Log on to the ApsaraDB for RDS console.
      2. In the top navigation bar, select the region where your RDS instance resides.
      3. Find your RDS instance and click its ID.
      4. On the Basic Information page, find the internal and public endpoints and their port numbers.
    • Port: Enter the port number of your RDS instance. If you connect to your RDS instance over an internal network, enter the internal port number of your RDS instance. If you connect to your RDS instance over the Internet, enter the public port number of your RDS instance.

    • Username: Enter the username of the privileged account that is used to log on to your RDS instance.

    • Password: Enter the password of the account that is used to log on to your RDS instance.

  6. Click Save.
  7. If the connection information is correct, choose Servers > Server Name > Databases > edb or postgres. The connection is successful if the following interface is displayed.
    Note edb and postgres are default system databases of your RDS instance. Do not perform any operation in these databases.

FAQ

How do I use Function Compute to obtain data from an RDS instance?

You can install third-party dependencies for your functions in Function Compute and use built-in modules to obtain the data of an RDS instance. For more information, see Install third-party dependencies.