Access on-premises or third-party cloud databases

更新时间:
复制 MD 格式

Database Gateway (DG) lets you use Alibaba Cloud services such as Data Management (DMS), Data Transmission Service (DTS), and Database Backup Service (DBS) to access databases in on-premises data centers or on third-party clouds. DG also provides a database access point, which lets applications on your ECS instances directly access these external databases.

访问本地或第三方云数据库

Database access point

A database access point from Database Gateway (DG) maps the endpoint of your on-premises or third-party cloud database to a VPC endpoint within your Alibaba Cloud VPC. Applications in your VPC can then access this VPC endpoint to connect to the original database as if it were a local resource.

For example, your on-premises database is at 10.1.2.3:3306. Due to network isolation, your applications on Alibaba Cloud cannot access this database directly. A database access point can map this address to a VPC endpoint, such as 172.6.7.8:5432, within your VPC. Your cloud applications can then connect to the database using the 172.6.7.8:5432 endpoint.

A database access point abstracts away the complexities of on-premises, cloud, and multi-cloud networking. This lets your applications on ECS instances securely access databases in any network environment. It is ideal for hybrid cloud use cases such as online applications, offline analytics, and data migration.

Prerequisites

  • Follow the instructions in Quick start to start the local agent and add a database.
  • Ensure that a VPC and a vSwitch are created in the same region as Database Gateway.

Procedure

  1. Log on to the Database Gateway console.
  2. In the left-side navigation pane, click Gateway List. Find the target gateway and click Details in the Operation column.
  3. On the gateway details page, find the target database and click Create a database access point in the Operation column.
  4. In the dialog box, select the target VPC ID and vSwitch, and then click OK.
  5. To verify the connection, log on to ECS instance within the VPC and test the connection to the displayed VPC endpoint. If the connection is successful, you can access your external database using methods like JDBC.
    [xxx]# telnet xxx
    Trying xxx...
    Connected to xxx.
    Escape character is '^]'.
    J
    5.7.280Z=hBV
            N]Rr&lp;Gi3Wmysql_native_password^]
    telnet> quit
    Connection closed.